Repository navigation
Use fsspec.parquet module for better remote-storage read_parquet performance - #8339
Conversation
|
I am not fully sure if the pyarrow-based engine should (always) make use of this. Similar optimization are already done by the parquet/dataset readers, and so if we don't get benefit of that when used through dask (which seems to be the case based on your timings above), we should maybe rather investigate why this is not the case. |
Yes - There is no reason that pyarrow cannot optimize the data transfer in a similar way, and so I do want the final iteration of this to make the |
|
@martindurant - I'm sorry that this is yet another "largish" PR, but I think your eyes would be very valuable here. In addition to a bit of kwarg-handling cleanup, the most controversial change is the addition of |
|
To the specific API:
|
I see - I also don’t expect any users to know or care about
I am fine with leaving the vanilla
I agree that it would be nice for these new “options” to be included in Perhaps the simplest solution to all this confusion is to simply check for _open_input_files(
paths,
fs=None,
open_file_func=None, # Defaults to `fs.open`
cache_type=None, # Allow "parquet" (in addition to "parts", etc)
cache_options=None, # Use as kwargs to `open_parquet_file` when cache_type="parquet"
**kwargs,
): |
|
Update: After an offline discussion with @martindurant, I decided to go with the following design:
|
|
I agree with everything in the comment above. |
Thanks @martindurant ! Before I settle on what we currently have in this PR, can I get your thoughts on the alternative proposal I recently described in fsspec#885? Note that I am currently favoring the "v2b" proposal (and the temporary logic required on the Dask side is only a minor change from what we have here). |
|
I will comment there soon |
|
Further Update to Previous Status: Due to a slight change in preference after compiling fsspec#885, all precache-related options should now be passed to This change is minor in terms of modified lines in this PR, and so I would be happy to further modify or roll back the tweak if necessary. However, to summarize the basic motivation: I feel that the precache phase must be explicitly seperate from cache initialization, and so a distinct argument for this separate phase seems necessary to me. |
|
It seems like you are generally supportive of the rough proposal in fsspec#885 @martindurant - Does this mean the |
|
yes, supportive! |
|
Is there any interest or time for a review this week @dask/io? Also, do we know of new people that we can invite to join the "dask/io" team? :) If no one has time to look through this in the next few days, I will likely do a deep review myself and merge on Friday. |
|
@martindurant - I plan to give this a final review soon, and will probably merge by the end of the day if there are no objections :) |
|
no objections here |
Depends on fsspec#813
The new
fsspec.parquet.open_parquet_filefunction offers an optimized version offs.openfor parquet-formatted data files. This PR updates both the "pyarrow" and "fastparquet"read_parquetimplementations to (optionally) leverage this new feature.API:
The new API change proposed in this PR is to add an
open_file_optionskwarg toread_parquet. This kwarg is intended as a central dictionary location for the user to define all options related to data-file opening. Within this dictionary, the user can specify an optimized "parquet" precaching strategy within a nested"cache_options"dictionary:We choose to define all cache-related options under
"cache_options"to simplify current and future fsspec integration. Although fsspec does not yet support the"precache"sub-field directly, there seems to be agreement that such a key can be recognized in the future (withinfs.openand related). Until then, Dask can simply perform a manual check for{"precache": "parquet"}and redirect thefs.opencall toopen_parquet_file.Blockers:
masterfsspec branch)import fsspec.parquetis a sufficient check for compatibility (or improve this check if it is not)open_parquet_file={}kwarg toread_parquetcan be used to pass kwargs tofsspec.parquet.open_parquet_filePerformance Motivation