Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projections do not work when select used view #63561

Closed
handgunman opened this issue May 9, 2024 · 1 comment
Closed

Projections do not work when select used view #63561

handgunman opened this issue May 9, 2024 · 1 comment

Comments

@handgunman
Copy link

CREATE TABLE t (id Int16, val Int32, dt Date) ENGINE=MergeTree Order by dt;

ALTER TABLE t
ADD PROJECTION prj_group
(
SELECT sum(val)
GROUP BY dt
);

insert into t values (1,10,'2024-05-01'),(2,20,'2024-05-01'),(3,30,'2024-05-01'),(4,40,'2024-05-01'),(5,50,'2024-05-01');

explain indexes = 1 select sum(val) from t;

create view v as select * from t;

explain indexes = 1 select sum(val) from v group by dt;

https://fiddle.clickhouse.com/720713cd-39b6-402d-a51a-60f3183e965a

@handgunman handgunman added the potential bug To be reviewed by developers and confirmed/rejected. label May 9, 2024
@Algunenano Algunenano added comp-view VIEWs comp-projections unfinished code duplicate and removed potential bug To be reviewed by developers and confirmed/rejected. labels May 9, 2024
@Algunenano
Copy link
Member

Duplicate #32753

@Algunenano Algunenano closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants