-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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 #62274 from ClickHouse/analyzer-fix-param-view-alias
Analyzer: Fix alias to parametrized view resolution
- Loading branch information
Showing
3 changed files
with
33 additions
and
1 deletion.
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
10 changes: 10 additions & 0 deletions
10
tests/queries/0_stateless/03033_analyzer_parametrized_view_alias.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,10 @@ | ||
0 | ||
1 | ||
2 | ||
3 | ||
4 | ||
5 | ||
6 | ||
7 | ||
8 | ||
9 |
20 changes: 20 additions & 0 deletions
20
tests/queries/0_stateless/03033_analyzer_parametrized_view_alias.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,20 @@ | ||
CREATE TABLE raw_data | ||
( | ||
`id` UInt8, | ||
`data` String | ||
) | ||
ENGINE = MergeTree | ||
ORDER BY id; | ||
|
||
|
||
INSERT INTO raw_data SELECT number, number | ||
FROM numbers(10); | ||
|
||
CREATE VIEW raw_data_parametrized AS | ||
SELECT * | ||
FROM raw_data | ||
WHERE (id >= {id_from:UInt8}) AND (id <= {id_to:UInt8}); | ||
|
||
SELECT t1.id | ||
FROM raw_data_parametrized(id_from = 0, id_to = 50000) t1 | ||
ORDER BY t1.id; |