-
Notifications
You must be signed in to change notification settings - Fork 72
[DF] Enable some distinct agg tests #786
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
charlesbluca
merged 16 commits into
dask-contrib:datafusion-sql-planner
from
andygrove:enable-distinct-tests
Sep 21, 2022
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
2982803
Revert to earlier version of rule and skip failing tests
andygrove 3171e73
add Rust workflow
andygrove 8a5810c
ci
andygrove 0088970
ci
andygrove e32ba14
fix remaining regressions in optimizer rule
andygrove 5eb5860
fmt
andygrove a4f2d59
save progress
andygrove b289bc4
Merge remote-tracking branch 'upstream/datafusion-sql-planner' into d…
andygrove 8027c7e
unignore tests
andygrove c1ac440
Merge branch 'distinct-fixes' into enable-distinct-tests
andygrove 4b7f17b
fix regression from agg with filter changes
andygrove 23c9ece
save progress
andygrove b18f75b
code cleanup
andygrove 1ef87d6
logging
andygrove bee7043
Merge branch 'datafusion-sql-planner' into enable-distinct-tests
galipremsagar 49bbe0c
lint
andygrove 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -276,13 +276,52 @@ def test_join_multi(): | |
| ) | ||
|
|
||
|
|
||
| def test_single_agg_count_no_group_by(): | ||
| a = make_rand_df( | ||
| 100, a=(int, 50), b=(str, 50), c=(int, 30), d=(str, 40), e=(float, 40) | ||
| ) | ||
| eq_sqlite( | ||
| """ | ||
| SELECT | ||
| COUNT(a) AS c_a, | ||
| COUNT(DISTINCT a) AS cd_a | ||
| FROM a | ||
| """, | ||
| a=a, | ||
| ) | ||
|
|
||
|
|
||
| def test_multi_agg_count_no_group_by(): | ||
| a = make_rand_df( | ||
| 100, a=(int, 50), b=(str, 50), c=(int, 30), d=(str, 40), e=(float, 40) | ||
| ) | ||
| eq_sqlite( | ||
| """ | ||
| SELECT | ||
| COUNT(a) AS c_a, | ||
| COUNT(DISTINCT a) AS cd_a, | ||
| COUNT(b) AS c_b, | ||
| COUNT(DISTINCT b) AS cd_b, | ||
| COUNT(c) AS c_c, | ||
| COUNT(DISTINCT c) AS cd_c, | ||
| COUNT(d) AS c_d, | ||
| COUNT(DISTINCT d) AS cd_d, | ||
| COUNT(e) AS c_e, | ||
| COUNT(DISTINCT e) AS cd_e | ||
| FROM a | ||
| """, | ||
| a=a, | ||
| ) | ||
|
|
||
|
|
||
| @pytest.mark.skip( | ||
| reason="conflicting aggregation functions: [('count', 'a'), ('count', 'a')]" | ||
| ) | ||
| def test_multi_agg_count_no_group_by(): | ||
| def test_multi_agg_count_no_group_by_dupe_distinct(): | ||
| a = make_rand_df( | ||
| 100, a=(int, 50), b=(str, 50), c=(int, 30), d=(str, 40), e=(float, 40) | ||
| ) | ||
| # note that this test repeats the expression `COUNT(DISTINCT a)` | ||
|
Collaborator
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. Do we want to open an issue to follow up on the dupe case later on?
Contributor
Author
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. Done: #787 |
||
| eq_sqlite( | ||
| """ | ||
| SELECT | ||
|
|
@@ -354,6 +393,7 @@ def test_agg_count(): | |
| a = make_rand_df( | ||
| 100, a=(int, 50), b=(str, 50), c=(int, 30), d=(str, 40), e=(float, 40) | ||
| ) | ||
| # note that this test repeats the expression `COUNT(DISTINCT a)` | ||
| eq_sqlite( | ||
| """ | ||
| SELECT | ||
|
|
||
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.
This is the main fix -
COUNT(col)instead ofCOUNT(1)