Personal project overlaps dask?
I'm working on a little project that may overlap or complement dask. I wanted to get your quick take on it, in case I'm duplicating your work.
Basically, my project ingests and organizes "annoyingly large" data. This is useful for research and prototyping on a personal machine.
For example, say I'm given a terabyte of JSON data, organized as 50 GB flat files. Each flat file may correspond to a division of the data, such as year, but is otherwise internally unsorted. The data in each file has useful features for stratification, e.g. date, location, user_id.
My project chunks the flat files and puts the JSON data into a partitioned tabular form, figuring out the partitions, features, etc., along the way. It then stores the partitioned data into nested subdirectories. This effectively creates multiple indexes, speeding up data access along more than one index.
I'm actually using dask for the last level of the indexing. I tried to use dask originally for the whole task, starting from the flat files, and it didn't seem to work well for me. Can you confirm that I haven't overlooked some easy way for dask to grok a 50 GB flat file (besides explicitly chunking)? This could simplify things.
Thanks for your time, dask is great.
Can you confirm that I haven't overlooked some easy way for dask to grok a 50 GB flat file (besides explicitly chunking)?
It's hard to say without a specific example. Dask itself is just concerned with executing tasks (functions on data), it doesn't really have a notion of a file.
Something like dask.bag could easily handle a 50GB JSONL file, since it operates line by line.
You might want to read http://dask.pydata.org/en/latest/bytes.html
On Tue, Aug 14, 2018 at 9:54 AM, Tom Augspurger [email protected] wrote:
Can you confirm that I haven't overlooked some easy way for dask to grok a 50 GB flat file (besides explicitly chunking)?
It's hard to say without a specific example. Dask itself is just concerned with executing tasks (functions on data), it doesn't really have a notion of a file.
Something like dask.bag could easily handle a 50GB JSONL file, since it operates line by line.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dask/dask/issues/3871#issuecomment-412879802, or mute the thread https://github.com/notifications/unsubscribe-auth/AASszJyAN4-lCgv6M5YtZdA_grWJcXB8ks5uQtapgaJpZM4V7xFR .
Thanks for your responses!
So it sounds like my project makes sense. There isn't a trivial way to do what I've described in dask yet.
As an aside, this discussion has lead me to look up who both you are and find your impressive content. Thanks for your time!
@TomAugspurger:
It's hard to say without a specific example. Dask itself is just concerned with executing tasks (functions on data), it doesn't really have a notion of a file.
This makes sense. I wasn't clear in my original post, I meant to say that it seems like I need to stage files, rather than use dask's caching behind the curtain for the initial ingest.
The context is that I need to partition a flatfile of JSON records by an arbitrary key. The file is generally larger than memory, so this led me to a staging strategy where I chunk and sort data. This is desirable because I can produce files of arbitrarily size, guaranteeing that subsequent operations will fit in memory.
The drawback is that this requires me to chunk, then partition the chunks, and then reassemble them. It seems like I have do this staging manually outside of dask for the large initial files. This is based on both of the answers below, .
https://stackoverflow.com/questions/48424813/dask-job-killed-because-memory-usage
https://stackoverflow.com/questions/51094865/memory-usage-when-indexing-a-large-dask-dataframe-on-a-single-multicore-machine
This is out of scope from the original question, but there is another strategy instead of sorting: using a filtering/plucking. Basically going over the data in multiple times, building files from each pass. The speed of this depends on the number of groups, as well as HD speed. There's probably some literature about this, do you have any thoughts?
@mrocklin:
You might want to read http://dask.pydata.org/en/latest/bytes.html
This is excellent and I'll read it. It is probably going to be useful in the future.
Right now, dask's higher level interfaces are working excellent for all operations after the staging described above.
There's probably some literature about this, do you have any thoughts?
I don't think I understand the context, but some of the code in dask/dataframe/partitionquantiles.py may be relevant here (or not).
Closing this, as I think there's nothing left for Dask to do here.