-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix: eliminate group by constant empty input #22132
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
Changes from all commits
4687667
2820196
5644a58
f4b957d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,10 +60,9 @@ FROM test_table t | |
| group by 1, 2, 3 | ||
| ---- | ||
| logical_plan | ||
|
Contributor
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. these plans are changing but I don't see the actual query results changing. Is that expected?
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. These all have the new filter, but their outputs are unchanged because the filter passes whenever count > 0. The empty input tests are in aggregate.slt. Those tests on main would return 1 row of NULL, these changes return 0 rows. |
||
| 01)Projection: Int64(123), Int64(456), Int64(789), count(Int64(1)), avg(t.c12) | ||
| 02)--Aggregate: groupBy=[[]], aggr=[[count(Int64(1)), avg(t.c12)]] | ||
| 03)----SubqueryAlias: t | ||
| 04)------TableScan: test_table projection=[c12] | ||
| 01)Aggregate: groupBy=[[Int64(123), Int64(456), Int64(789)]], aggr=[[count(Int64(1)), avg(t.c12)]] | ||
| 02)--SubqueryAlias: t | ||
| 03)----TableScan: test_table projection=[c12] | ||
|
|
||
| query TT | ||
| EXPLAIN | ||
|
|
@@ -72,8 +71,8 @@ FROM test_table t | |
| GROUP BY 1, 2 | ||
| ---- | ||
| logical_plan | ||
| 01)Projection: Date32("2023-05-04") AS dt, Boolean(true) AS today_filter, count(Int64(1)) | ||
| 02)--Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]] | ||
| 01)Projection: to_date(Utf8("2023-05-04")) AS dt, date_part(Utf8("DAY"),now()) < Int64(1000) AS today_filter, count(Int64(1)) | ||
| 02)--Aggregate: groupBy=[[Date32("2023-05-04") AS to_date(Utf8("2023-05-04")), Boolean(true) AS date_part(Utf8("DAY"),now()) < Int64(1000)]], aggr=[[count(Int64(1))]] | ||
| 03)----SubqueryAlias: t | ||
| 04)------TableScan: test_table projection=[] | ||
|
|
||
|
|
@@ -90,10 +89,9 @@ FROM test_table t | |
| GROUP BY 1 | ||
| ---- | ||
| logical_plan | ||
| 01)Projection: Boolean(true) AS NOT date_part(Utf8("MONTH"),now()) BETWEEN Int64(50) AND Int64(60), count(Int64(1)) | ||
| 02)--Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]] | ||
| 03)----SubqueryAlias: t | ||
| 04)------TableScan: test_table projection=[] | ||
| 01)Aggregate: groupBy=[[Boolean(true) AS NOT date_part(Utf8("MONTH"),now()) BETWEEN Int64(50) AND Int64(60)]], aggr=[[count(Int64(1))]] | ||
| 02)--SubqueryAlias: t | ||
| 03)----TableScan: test_table projection=[] | ||
|
|
||
| query TT | ||
| EXPLAIN | ||
|
|
@@ -119,7 +117,7 @@ logical_plan | |
|
|
||
| # Config reset | ||
|
|
||
| # The SLT runner sets `target_partitions` to 4 instead of using the default, so | ||
| # The SLT runner sets `target_partitions` to 4 instead of using the default, so | ||
| # reset it explicitly. | ||
| statement ok | ||
| set datafusion.execution.target_partitions = 4; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.