Repository navigation
Allowing fastparquet to handle gather_statistics=False for file lists - #5157
Conversation
…_statistics=False
|
I am currently testing this. So far so good. I can load my dataset in a few seconds with 1800 partitions. Game changing! I will keep working on this branch and see how I get on. But this has definitely passed my bug from yesterday. Thank you so much for the quick turnaround! |
|
I second what @birdsarah says - it's great to have someone handling parquet stuff quickly! |
dask.parquet.bus_factor += 1 |
|
I have also successfully loaded my data with the latest commit. I have not checked the directory pathway. If you give me some example inputs I can test them on my real setup. I am now successfully working on a dataset with 74,000 partitions and no _metadata. Opening dataset and df.head() takes 7 - 30s. (Presumably depending on whether s3fs cache is cold or not). THIS IS HUGE! This was literally impossible before. |
|
Woo!
…On Thu, Jul 25, 2019 at 5:05 PM Sarah Bird ***@***.***> wrote:
I have also successfully loaded my data with this branch. I have not
checked the directory pathway. If you give me some example inputs I can
test them on my real setup.
I am now successfully working on a dataset with 74,000 partitions and no
_metadata.
Opening dataset and df.head() takes 7 - 30s. (Presumably depending on
whether s3fs cache is cold or not). THIS IS HUGE! This was literally
impossible before.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5157?email_source=notifications&email_token=AACKZTBGWXJKYTS355CBUHTQBI5TRA5CNFSM4IG4PYNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD23DNSA#issuecomment-515258056>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACKZTBO7HQROIMG4QXTBRLQBI5TRANCNFSM4IG4PYNA>
.
|
|
@birdsarah Following my comment in issue#4701, I made some changes here that should allow the pyarrow engine to be used to open a list or directory of files without As noted by @wesm, the |
…nges from PR#5150)
|
I'm confused @rjzamora. Do you want me to work on my PR or do you just want to do it here? |
|
@birdsarah I added your changes before I knew you were picking back up (just because we are trying to tie up loose ends for a release). I'd actually prefer to have your PR separately merged - I am mostly incorperating your changes here as a check that I haven't brocken anything for you |
|
ok cool. i'll see my pr through ci today. has anyone tested your new pyarrow metadata? i can test it on my large dataset if it's useful. |
That would be great! |
|
Hmmmm.....I'm not sure this is an issue with your PR but it might be.....or my error might mean success for your PR :D I'm trying to read my 74k partition parquet data with pyarrow. I get the following error after ~20s, which seems reasonable to me. ---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
<timed exec> in <module>
/mnt/miniconda/envs/jestr-etl/lib/python3.7/site-packages/dask/dataframe/io/parquet/core.py in read_parquet(path, columns, filters, categories, index, storage_options, engine, gather_statistics, **kwargs)
153 gather_statistics=gather_statistics,
154 filters=filters,
--> 155 **kwargs
156 )
157 if meta.index.name is not None:
/mnt/miniconda/envs/jestr-etl/lib/python3.7/site-packages/dask/dataframe/io/parquet/arrow.py in read_metadata(fs, paths, categories, index, gather_statistics, filters, **kwargs)
168 )
169
--> 170 dtypes = _get_pyarrow_dtypes(schema, categories)
171 dtypes = {storage_name_mapping.get(k, k): v for k, v in dtypes.items()}
172
/mnt/miniconda/envs/jestr-etl/lib/python3.7/site-packages/dask/dataframe/io/utils.py in _get_pyarrow_dtypes(schema, categories)
38 numpy_dtype = pandas_metadata_dtypes[field.name]
39 else:
---> 40 numpy_dtype = field.type.to_pandas_dtype()
41
42 dtypes[field.name] = numpy_dtype
/mnt/miniconda/envs/jestr-etl/lib/python3.7/site-packages/pyarrow/types.pxi in pyarrow.lib.DataType.to_pandas_dtype()
NotImplementedError: struct<key_value: list<key_value: struct<key: string, value: string> not null>>Why might it be related: This pr updates the definition of dataset to which is what then makes a schema which is passed into _get_pyarrow_dtypes. But it may be that nothing about this actually changed. And that I never got to this error message before because it was trying to read metadata from 74k files, which never finished. So this error may actually be a sign of success. Of course, if you happen to know how to work around this NotImplementedError that would be amazing because my data is actually this wierd nested struct. (https://gitter.im/dask/dask?at=5d3b445e0d0ffc39758b138f) |
Right - Sorry, that is probably the issue here. The new You are most-likely right that you would have had the same problem before this PR, but just needed to wait a lot longer to find out :) |
Then I think this is a success. Unfortunately I don't have a dataset to hand that is v. large and has simple datatypes. I will note that I was only trying to read in one column, that was just an integer field. What do you think about opening an issue that adds, as a follow-on optimization, only inferring metadata for the requested columns? |
Sure - That might be a reasonable workaround. In the mean time, I put the |
|
Testing |
|
This worked. Was able to read in 1 column of my 74k partition dataset with |
|
To be clear, this was working too for fastparquet? |
100% yes. Both have been tested against very high n partition data with no _metadata / _common_metadata. |
|
@martindurant Can you review these changes at your convenience? I will rebase/merge after #5150 goes through, but that should only change some test names. |
|
How important is it to get this PR in before the release? Is there a regression here? (poking @martindurant for review, if he has time) Also, I'll admit that I'm a little scared by the amount of extra logic introduced here (though of course it may be necessary) |
|
@mrocklin That is a fair question. The previous fastparquet engine couldn't handle Although the It does worry me to push this through in a rush, but most of these changes probably should have been in the original refactor anyway. With that said, since we are no longer scanning every file in |
|
@martindurant can you provide a judgement call here? Should this be merged in? Should it go into the upcoming release? I'm at a point where I would like to cut a dask/dask release, and am not sure if this should go in or not. |
|
Sorry, I haven't had the chance to look through it yet. I think the idea of the functionality is simple enough (in concept, if not implementation) and this is certainly useful in many cases. Given only limited opportunity for regression, as described above, I'd be fairly pro. I have traditionally been less cautious than others, however. |
|
The green button is sitting there waiting for you if you feel lucky
…On Wed, Jul 31, 2019 at 10:48 AM Martin Durant ***@***.***> wrote:
Sorry, I haven't had the chance to look through it yet. I think the idea
of the functionality is simple enough (in concept, if not implementation)
and this is certainly useful in many cases. Given only limited opportunity
for regression, as described above, I'd be fairly pro. I have traditionally
been less cautious than others, however.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5157?email_source=notifications&email_token=AACKZTHK4GV5RQNRKVSOYKDQCHF6XA5CNFSM4IG4PYNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3IA75I#issuecomment-516952053>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACKZTFESTIUYOBW22WSKATQCHF6XANCNFSM4IG4PYNA>
.
|
|
For what it's worth. This is extremely helpful for my current workflows and I'll end up continuing to work in production on a manually installed branch version if this doesn't make it into release. If there's regressions and fall out I'm happy to commit to helping with testing fixes if that's useful. |
This is hopefully a fix for the bug raised in Issue#5153. The specific changes are in line with this comment.
In the fastparquet engine, it is possible to take in a list of files, but have
gather_statistics=False. This case was previously untested. I added a new test (test_read_glob_nostats), and tweaked the engine a bit to allow thepartsoutput ofread_metadatato (optionally) include file paths rather than row-group information.black dask/flake8 dask