Skip to content

Fix parquet getitem optimization - #7106

Merged
TomAugspurger merged 2 commits into
dask:masterfrom
rjzamora:fix-getitem-optimization
Jan 25, 2021
Merged

TomAugspurger merged 2 commits into
dask:masterfrom
rjzamora:fix-getitem-optimization

Conversation

@rjzamora

Copy link
Copy Markdown
Member

Addresses column-selection component of #7090

It seems that #5917 added a change to optimize_read_parquet_getitem that bails on the parquet optimization whenever a getitem task is in the list of requested keys. This means that the optimization is skipped when the column selection is the last thing the user does before computing/persisting. I may be misunderstanding, but I don't think this change makes sense.
The original problem in #5893 was that the read-parquet task was in the list of requested keys (not that the getitem task was included). As far as I can tell, we just need to check that the read-parquet tasks are not in the list of requested keys, otherwise we cannot change the name of that layer during the optimization.

This PR changes the optimize_read_parquet_getitem logic to bail if the requested keys include any keys from the read-parquet layer. This is the "conservative" approach, since it is probably fine to continue with the optimization if we preserve the original name. Note that I may be misunderstanding the reason for the original logic, so please do let me know if this makes sense (cc @TomAugspurger).

@TomAugspurger TomAugspurger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks!

Comment thread dask/dataframe/optimize.py Resolved
@TomAugspurger

Copy link
Copy Markdown
Member

Thanks! I believe the CI failure is unrelated.

@TomAugspurger
TomAugspurger merged commit 5c96d82 into dask:master Jan 25, 2021
@rjzamora
rjzamora deleted the fix-getitem-optimization branch January 25, 2021 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants