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
{{ message }}
Repository navigation
Altering columns on underlying table has no effect on view create statement when using SELECT * #19087
on ClickHouse server version 20.12.4 revision 54442:
b2344c4eb05b :) CREATE TABLE tbl ( a String ) ENGINE = MergeTree() ORDER BY a
Ok.
0 rows inset. Elapsed: 0.010 sec.
b2344c4eb05b :) CREATE VIEW tbl_view ASSELECT*FROM tbl
Ok.
0 rows inset. Elapsed: 0.008 sec.
b2344c4eb05b :) ALTER TABLE tbl ADD COLUMN b String ALIAS a
Ok.
0 rows inset. Elapsed: 0.008 sec.
b2344c4eb05b :) SELECT b FROM tbl_view
Received exception from server (version 20.12.4):
Code: 47. DB::Exception: Received fromhost.docker.internal:9000. DB::Exception: Missing columns: 'b' while processing query: 'SELECT b FROM (SELECT * FROM default.tbl) AS tbl_view', required columns: 'b', source columns: 'a'.
0 rows inset. Elapsed: 0.007 sec.
I guess the problem lies in the create tables query:
changed the title [-]Altering columns on underlying table has no effect on create statement when using SELECT *[/-][+]Altering columns on underlying table has no effect on view create statement when using SELECT *[/+]on Jan 14, 2021
Activity
[-]Altering columns on underlying table has no effect on create statement when using SELECT *[/-][+]Altering columns on underlying table has no effect on view create statement when using SELECT *[/+]alexey-milovidov commentedon Oct 19, 2022
This is expected. Views' structure is determined at creation time.
fix(clickhouse): probe views with SELECT * so a view broken by ALTER …