-
Notifications
You must be signed in to change notification settings - Fork 70
[DF] Add support for filtered groupby aggregations #760
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
Merged
ayushdg
merged 8 commits into
dask-contrib:datafusion-sql-planner
from
charlesbluca:df-filter-where
Sep 21, 2022
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
40b861c
Uncomment test_group_by_filtered
charlesbluca c6f6e06
Merge branch 'datafusion-sql-planner' into df-filter-where
galipremsagar 4de1390
Merge branch 'datafusion-sql-planner' into df-filter-where
galipremsagar 646b9e8
Enable filtered aggs, implement get_filter_expr
charlesbluca 665fe84
Compute filter columns in _collect_aggregations
charlesbluca a5224e8
Resolve test failures
charlesbluca ea797f2
Add back in aggregate function assertion
charlesbluca cbeb7e3
Merge remote-tracking branch 'origin/datafusion-sql-planner' into df-…
charlesbluca 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
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.
A potential issue with
new_temporary_columnthat came to mind while working on this (I say potential because I'm unsure of the behavior ofuuid.uuid4()):Since we're using the table's
columnsattribute to check that a random column name hasn't been used yet, and we don't actually assign any of these random columns names until several of them have been generated, it is technically possible (though rare) to accidentally assign multiple input / filter columns to the same random backend name, which will certainly cause issues.Since
assigncalls are expensive and we ideally want to be adding all required backend columns in a single go, it might make sense to refactornew_temporary_columnto instead look at some attribute of theDataContainerorColumnContainerto check for duplicates, which are both cheaper to update on the fly.Don't intend to block this PR, but could be worthwhile to open an issue / TODO to handle this down the line.
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.
Agreed that moving the check to dc or cc should make things significantly cheaper.
Based on the article here probability of name collision is almost negligible, especially at the scale at which we generate new columns