203 points · by craigkerstiens · 2y ago · 39 comments
I know most software folks feel some type of way about SQL (most don’t grok it beyond a simple SELECT) but this is one of the advantages of declarative languages like SQL and a plan-execute programming paradigm where a plan is created before instructions are run, making it amenable to plan optimization.
Maybe the syntax of the language could be improved (e.g. Linq) but conceptually SQL is historically when we’ve blundered into the right. Data operations are often done in sets rather than loops and it’s a worthwhile investment for software engineers to learn to think in this way if they want to work with data correctly at scale.
Stonebraker was right in that people who avoid SQL are doomed to reinvent it poorly.
For duckdb, ibis looks like a pretty nice way of using the duckdb query engine.
Pandas? Not even once.
It maps to SQL semantics fairly cleanly, but is more expressive and composable.
I'm pretty excited for variables too! I really wanted them for when I'm using the CLI. Same with query/query_table! I appreciate the push for features that make people's lives easier while also still improving performance.
Everyone who I've introduced duckdb to (at work or outside of work) eventually is blown away (some still have lingering SQL stigma)
Has saved us a number of times when having to deploy at a remote client with limited on-prem customisation for security reasons (ie. no to installing a big Postgres or other RDBMS solution).
Powerful tooling; all local to the environment and the data being worked on; SQL, so it's pretty close to a drop-in replacement compared to our old solution. Really great stuff and I was very happy to see the project gain the confidence to hit 1.0 a while back and now 1.1.
Congrats to everyone!
Ref: https://duckdb.org/docs/sql/statements/transactions
In the concurrency documentation they explicitly specify that it's not designed for lots of small transactions
Concurrency: https://duckdb.org/docs/connect/concurrency
I am quite curious about the plans for python dataframe like API for duckdb, and python ecosystem in general.
With tools like this providing a comprehensive python API and the ability to always fall back to raw SQL, i am not sure DuckDB devs should focus on the python API at all beyond basic (to_table, from_table) features.
Impressive progress and a real chance to shake up the data tool market, but still a way to go: There is is still much to do especially on large table formats (iceberg/delta) and memory management when running on bigger boxes on cloud. Eg the elusive "Failed to allocate ..." bug[1] is an inhibitor to the claim that big data is dead[2]. As it is, we tried and abandoned DuckDB as a cheaper replacement for some databricks batch jobs.
[0] https://github.com/ibis-project/ibis [1] https://github.com/duckdb/duckdb/issues/12667, https://github.com/duckdb/duckdb/issues/9880, https://github.com/duckdb/duckdb/issues/12528 [2] https://motherduck.com/blog/big-data-is-dead/
https://duckdb.org/docs/api/python/spark_api
Not sure what the current status is.
ref: https://github.com/duckdb/duckdb/issues/2000#issuecomment-18...
df = pd.DataFrame({"a": [1,2,3], "b": [4,5,6]}) # New Pandas dataframe
df2 = duckdb.query("select 2*a as c, b from df") # DuckDB
df3 = df2.df() # materialize as Pandas, .pl() for Polars
ml_df = ML.func(df3) # pass dataframe into ML function
df4 = duckdb.query("select count(distinct x) from ml_df")SELECT 1 / 0 AS var_name;
yields a double with value infinite. Which is SQL spec. Must be fun times to actually use that :-)
For example, 'select 1.0/(1.0/0.0)' becomes 0.0 again. This allows for inf/nans to be canceled out instead of having to do error checking and exception handling every time one crops up.