It’s actually faster than AWS Athena for me.
It’s actually faster than AWS Athena for me.
Just the other day I used it to transform an unordered 60 GB CSV file with links and texts into a 3 GB parquet file that's so fast I can create a projection for the relevant data of each partition in like a minute (which then fits in memory).
It has some minor stability issues so I'm not sure I'd build a full blown application on top of it, but for data transformation tasks it's amazing.
And no you don’t have to know the exact parquet file. You would treat the Hive partitioned data as a single dataset and DuckDB will scan it automatically. (Partition elimination, predicate pushdown etc all done automatically)
We are in the same scenario (querying lots of Parquet files in S3) and we noticed that DuckDB quickly crashes with OOMs in environments with a few gigs of RAM.
Setting the memory limit setting or the disk swap file has not worked.
I used to have to chunk my data to avoid OOMs but I haven’t had to do that.
That said there are a few more out of core strategies on the roadmap that have not yet been implemented. If you still get OOMs, chunking your data will help.
Also consider that few gigs of RAM might not be large enough for your workload. Out of core strategies can only do so much.
what does chunking data mean here?..
Or if you have a unique string ID, calculate an integer hash using hash(ID) % 50 to get 50 chunks which you can process separately without OOMing.
A basic assumption is that all the chunks are independent of each other. Chunking is essentially temporary partitioning to fit your processing limitations.
Say, I have large table A, which I want to group by. I can chunk it into small tables, for example:
for i in range(64): execute('create table_%i as select * from A where hash(id) % 64 = %i')
but this would mean scanning source table 64 times which is likely not efficient, I am wondering if duckdb has some functionality which can do more efficient chunking?
(Head of Produck at MotherDuck and a huge fan of DuckDB)