forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ClickHouse#63405 from ClickHouse/vdimir/group_by_u…
…se_nulls_fixes Small fixes for group_by_use_nulls
- Loading branch information
Showing
8 changed files
with
89 additions
and
2 deletions.
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
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
14 changes: 14 additions & 0 deletions
14
tests/queries/0_stateless/03150_grouping_sets_use_nulls_pushdown.reference
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
2023-01-05 hello, world | ||
2023-01-05 \N | ||
2023-01-05 hello, world | ||
2023-01-05 \N | ||
2023-01-05 | ||
2023-01-05 | ||
2023-01-05 hello, world | ||
2023-01-05 \N | ||
2023-01-05 hello, world | ||
2023-01-05 \N | ||
2023-01-05 10 | ||
2023-01-05 10 | ||
2023-01-05 hello, world | ||
2023-01-05 \N |
49 changes: 49 additions & 0 deletions
49
tests/queries/0_stateless/03150_grouping_sets_use_nulls_pushdown.sql
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
DROP TABLE IF EXISTS test_grouping_sets_predicate; | ||
|
||
CREATE TABLE test_grouping_sets_predicate ( day_ Date, type_1 String ) ENGINE=MergeTree ORDER BY day_; | ||
|
||
INSERT INTO test_grouping_sets_predicate SELECT toDate('2023-01-05') AS day_, 'hello, world' FROM numbers (10); | ||
|
||
SET group_by_use_nulls = true; | ||
|
||
SELECT * | ||
FROM ( SELECT day_, type_1 FROM test_grouping_sets_predicate GROUP BY GROUPING SETS ( (day_, type_1), (day_) ) ) | ||
WHERE day_ = '2023-01-05' | ||
ORDER BY ALL; | ||
|
||
|
||
SELECT * | ||
FROM ( SELECT * FROM test_grouping_sets_predicate GROUP BY GROUPING SETS ( (day_, type_1), (day_) ) ) | ||
WHERE day_ = '2023-01-05' | ||
ORDER BY ALL; | ||
|
||
SELECT * | ||
FROM ( SELECT day_ FROM test_grouping_sets_predicate GROUP BY GROUPING SETS ( (day_, type_1), (day_) ) ) | ||
WHERE day_ = '2023-01-05' | ||
ORDER BY * | ||
SETTINGS allow_experimental_analyzer=1; | ||
|
||
SELECT * | ||
FROM ( SELECT * FROM test_grouping_sets_predicate GROUP BY GROUPING SETS ( (day_, type_1), (day_) ) ) | ||
WHERE day_ = '2023-01-05' | ||
GROUP BY * | ||
ORDER BY ALL | ||
SETTINGS allow_experimental_analyzer=1; | ||
|
||
SELECT * | ||
FROM ( SELECT * FROM test_grouping_sets_predicate GROUP BY GROUPING SETS ( (*), (day_) ) ) | ||
WHERE day_ = '2023-01-05' | ||
GROUP BY GROUPING SETS (*) | ||
ORDER BY type_1 | ||
SETTINGS allow_experimental_analyzer=1; | ||
|
||
SELECT * | ||
FROM ( SELECT day_, COUNT(*) FROM test_grouping_sets_predicate GROUP BY GROUPING SETS ( (day_, type_1), (day_) ) ) | ||
WHERE day_ = '2023-01-05' | ||
ORDER BY ALL; | ||
|
||
|
||
SELECT t2.* | ||
FROM ( SELECT t1.* FROM test_grouping_sets_predicate t1 GROUP BY GROUPING SETS ( (day_, type_1), (day_) ) ) t2 | ||
WHERE day_ = '2023-01-05' | ||
ORDER BY ALL; |