-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fuse more aggressively if parquet files are tiny #1029
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
efc260a
Fuse for size as well
phofl 061196d
Fixup
phofl 496eab1
split also for one key
phofl f6cdc44
split also for one key
phofl f6b7438
Update isin implementation
phofl d0c9e99
Fixup
phofl 4793dad
Remove shuffle stuff
phofl 088da94
Fixuo
phofl 1a6e4dd
Fixup
phofl 0c2489d
Fixup
phofl 95930fd
Fixup
phofl 974ba6f
Fixup
phofl 24a3fab
Fixup
phofl a6f2b25
Merge branch 'main' into fuse_size1
fjetter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -821,6 +821,8 @@ def sample_statistics(self, n=3): | |
ixs = [] | ||
for i in range(0, nfrags, stepsize): | ||
sort_ix = finfo_argsort[i] | ||
# TODO: This is crude but the most conservative estimate | ||
sort_ix = sort_ix if sort_ix < nfrags else 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see #1032 |
||
ixs.append(sort_ix) | ||
finfos_sampled.append(finfos[sort_ix]) | ||
frags_samples.append(frags[sort_ix]) | ||
|
@@ -1001,17 +1003,17 @@ def fragments_unsorted(self): | |
|
||
@property | ||
def _fusion_compression_factor(self): | ||
if self.operand("columns") is None: | ||
return 1 | ||
approx_stats = self.approx_statistics() | ||
total_uncompressed = 0 | ||
after_projection = 0 | ||
col_op = self.operand("columns") | ||
col_op = self.operand("columns") or self.columns | ||
for col in approx_stats["columns"]: | ||
total_uncompressed += col["total_uncompressed_size"] | ||
if col["path_in_schema"] in col_op: | ||
after_projection += col["total_uncompressed_size"] | ||
|
||
min_size = dask.config.get("dataframe.parquet.minimum-partition-size") | ||
total_uncompressed = max(total_uncompressed, min_size) | ||
return max(after_projection / total_uncompressed, 0.001) | ||
|
||
def _filtered_task(self, index: int): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't we always shuffle now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
except if split_out=1 is set explicitly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We just had a conversation about this and agreed that we'll go for this automatic behavior. This means that some group by operations will perform a bit worse since we are forcing a shuffle that is not strictly necessary.
For large output results the shuffle is a necessity and for tiny output results, the additional shuffle step only adds a marginal performance penalty in our testing since it operates on the already reduced data.
It is a safer choice and most users will not want to or be able to dig in deep enough to set this parameter such that this is a good default choice.