-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix PREWHERE with FINAL (forbid reusing expression calculated on PREW…
…HERE step) In case of FINAL the result of the expression for PREWHERE can be changed after applying merge algorithm. Note, analyzer does not has this bug because it simply does not reuse columns from PREWHERE (they does not passed via GlobalPlannerContext::createColumnIdentifier()) Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com> v2: update tests references (see https://s3.amazonaws.com/clickhouse-test-reports/54436/baaa688f40fcd064952f62dc8c62ddc752dd0046/fast_test.html)
- Loading branch information
Showing
5 changed files
with
19 additions
and
9 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
Empty file.
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,9 @@ | ||
drop table if exists data; | ||
|
||
create table data (key Int, val1 SimpleAggregateFunction(max, Nullable(Int)), val2 SimpleAggregateFunction(min, Int)) engine=AggregatingMergeTree() order by key; | ||
system stop merges data; | ||
|
||
insert into data values (1,10,100); | ||
insert into data values (1,20,10); | ||
|
||
select key, val1, val2, assumeNotNull(val1) > val2 x1, val1 > val2 x2 from data final prewhere assumeNotNull(val1) > 0 where x1 != x2 settings max_threads=1; |