-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix panic in multiple distinct aggregates by fixing ScalarValue::new_list
#7989
Changes from all commits
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 |
---|---|---|
|
@@ -75,3 +75,4 @@ opt-level = 3 | |
overflow-checks = false | ||
panic = 'unwind' | ||
rpath = false | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2020,14 +2020,6 @@ statement ok | |
drop table t; | ||
|
||
|
||
|
||
|
||
statement error DataFusion error: Execution error: Table 't_source' doesn't exist\. | ||
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. drive by cleanup -- this looks like it was a copy/paste of the statements immediately above, so I removed the duplication |
||
drop table t_source; | ||
|
||
statement error DataFusion error: Execution error: Table 't' doesn't exist\. | ||
drop table t; | ||
|
||
query I | ||
select median(a) from (select 1 as a where 1=0); | ||
---- | ||
|
@@ -2199,6 +2191,26 @@ NULL 1 10.1 10.1 10.1 10.1 0 NULL | |
statement ok | ||
set datafusion.sql_parser.dialect = 'Generic'; | ||
|
||
## Multiple distinct aggregates and dictionaries | ||
statement ok | ||
create table dict_test as values (1, arrow_cast('foo', 'Dictionary(Int32, Utf8)')), (2, arrow_cast('bar', 'Dictionary(Int32, Utf8)')); | ||
|
||
query I? | ||
select * from dict_test; | ||
---- | ||
1 foo | ||
2 bar | ||
|
||
query II | ||
select count(distinct column1), count(distinct column2) from dict_test group by column1; | ||
---- | ||
1 1 | ||
1 1 | ||
|
||
statement ok | ||
drop table dict_test; | ||
|
||
|
||
# Prepare the table with dictionary values for testing | ||
statement ok | ||
CREATE TABLE value(x bigint) AS VALUES (1), (2), (3), (1), (3), (4), (5), (2); | ||
|
@@ -2282,6 +2294,13 @@ select max(x_dict) from value_dict group by x_dict % 2 order by max(x_dict); | |
4 | ||
5 | ||
|
||
statement ok | ||
drop table value | ||
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. Drive By cleanup: added clean up from the test, which I noticed while working on this PR |
||
|
||
statement ok | ||
drop table value_dict | ||
|
||
|
||
# bool aggregation | ||
statement ok | ||
CREATE TABLE value_bool(x boolean, g int) AS VALUES (NULL, 0), (false, 0), (true, 0), (false, 1), (true, 2), (NULL, 3); | ||
|
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.
I am not sure why this function was implemented like this, but it is much more concisely (and completely) implemented in terms of arrays and offsets.
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.
Nice clean up.