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

Pass virtual column from inner table to materialized view #11210

Closed
filimonov opened this issue May 26, 2020 · 1 comment · Fixed by #33482
Closed

Pass virtual column from inner table to materialized view #11210

filimonov opened this issue May 26, 2020 · 1 comment · Fixed by #33482
Labels
comp-matview Materialized views easy task Good for first contributors feature minor Priority: minor

Comments

@filimonov
Copy link
Contributor

create table x engine=MergeTree ORDER BY tuple() as select * from numbers(100);
create materialized view x_mv engine=MergeTree ORDER BY tuple() as select * from x;
insert into x select * from numbers(100);

That works:

select _part, count() from `.inner.x_mv` group by _part;

SELECT 
    _part, 
    count()
FROM `.inner.x_mv`
GROUP BY _part

┌─_part─────┬─count()─┐
│ all_1_1_0 │     100 │
└───────────┴─────────┘

1 rows in set. Elapsed: 0.004 sec.

That - not:

select _part, count() from x_mv group by _part;
Received exception from server (version 20.5.1):
Code: 47. DB::Exception: Received from localhost:9000. DB::Exception: Missing columns: '_part' while processing query: 'SELECT _part, count() FROM x_mv GROUP BY _part', required columns: '_part', source columns: 'number'. 

@filimonov filimonov added feature comp-matview Materialized views minor Priority: minor labels May 26, 2020
@alexey-milovidov alexey-milovidov added the easy task Good for first contributors label Dec 5, 2021
@lingtaolf
Copy link
Contributor

@alexey-milovidov I'm interested in this and I hope to work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-matview Materialized views easy task Good for first contributors feature minor Priority: minor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants