forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 3
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#27531 from abel-cheng/with-constants
Enable using constants from with and select in aggregate function parameters.
- Loading branch information
Showing
4 changed files
with
55 additions
and
0 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
5 changes: 5 additions & 0 deletions
5
tests/queries/0_stateless/02006_use_constants_in_with_and_select.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,5 @@ | ||
1 [1] | ||
[1] | ||
99.9 | ||
0.1 99.9 | ||
[99.9] |
36 changes: 36 additions & 0 deletions
36
tests/queries/0_stateless/02006_use_constants_in_with_and_select.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,36 @@ | ||
SELECT | ||
1 AS max_size, | ||
groupArray(max_size)(col) | ||
FROM | ||
( | ||
SELECT 1 AS col | ||
UNION ALL | ||
SELECT 2 | ||
); | ||
|
||
WITH 1 AS max_size | ||
SELECT groupArray(max_size)(col) | ||
FROM | ||
( | ||
SELECT 1 as col | ||
UNION ALL | ||
SELECT 2 | ||
); | ||
|
||
WITH 0.1 AS level | ||
SELECT quantile(level)(number) | ||
FROM numbers(1000); | ||
|
||
SELECT 0.1 AS level, quantile(level)(number) | ||
FROM numbers(1000); | ||
|
||
WITH | ||
0.1 AS level, | ||
1 AS max_size | ||
SELECT groupArray(max_size)(col) | ||
FROM | ||
( | ||
SELECT quantile(level)(number) AS col | ||
FROM numbers(1000) | ||
); | ||
|