Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Cannot Reproduce
-
1.11.1
-
None
Description
CREATE TABLE table_01 ( aaa varchar, bbb varchar) WITH(.......); CREATE TABLE table_02 ( aaa varchar, bbb varchar) WITH(.......); create view my_view as select aaa,bbb from ( select aaa,bbb from table_01 union all select aaa,bbb from table_02 ); create table bsql_log ( aaa varchar, bbb varchar) with ( 'connector' = 'log'); insert into bsql_log SELECT aaa,bbb FROM my_view
Run the above code will report an error:
org.apache.calcite.runtime.CalciteContextException: From line 1, column 8 to line 1, column 15: Table 'EXPR$1' not found
But if I assign an alias to the result of union all, it can be normal.
create view my_view as select aaa,bbb from ( select aaa,bbb from table_01 union all select aaa,bbb from table_02 ) as union_result;