You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You have to provide the following information whenever possible.
Wrong behavior for the filter using prefer_column_name_to_alias = 1
CREATE TABLE loans (loan_number int, security_id text) ENGINE=Memory;
INSERT INTO loans VALUES (1, 'AAA');
INSERT INTO loans VALUES (1, 'AAA');
INSERT INTO loans VALUES (1, 'AAA');
INSERT INTO loans VALUES (1, 'AAA');
INSERT INTO loans VALUES (1, 'AAA');
INSERT INTO loans VALUES (1, 'BBB');
INSERT INTO loans VALUES (1, 'BBB');
INSERT INTO loans VALUES (1, 'BBB');
INSERT INTO loans VALUES (1, 'BBB');
INSERT INTO loans VALUES (1, 'BBB');
INSERT INTO loans VALUES (1, 'BBB');
with block_0 as (
select * from loans
),
block_1 as (
select sum(loan_number) as loan_number from block_0 group by security_id
)
select loan_number from block_1 where loan_number > 3 settings prefer_column_name_to_alias = 1
In this query filter loan_number > 3 for some reason will not operate on the aggregation.
By the logic original column name here should not be available, as the context after aggregation should be different and alias should be used.
Wrong behavior for the filter using prefer_column_name_to_alias = 1
In this query filter loan_number > 3 for some reason will not operate on the aggregation.
By the logic original column name here should not be available, as the context after aggregation should be different and alias should be used.
https://fiddle.clickhouse.com/aa990c59-25a1-4562-9bea-17f43bd9f78f
Does it reproduce on recent release?
yes
Expected behavior
Expected output for the query above is
5
6
Please help with this bug.
The text was updated successfully, but these errors were encountered: