[jira] [Created] (FLINK-20466) Table 'EXPR$1' not found with UNION ALL

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-20466) Table 'EXPR$1' not found with UNION ALL

Shang Yuanchun (Jira)
wxmimperio created FLINK-20466:
----------------------------------

             Summary: Table 'EXPR$1' not found with UNION ALL
                 Key: FLINK-20466
                 URL: https://issues.apache.org/jira/browse/FLINK-20466
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Planner
    Affects Versions: 1.11.1
            Reporter: wxmimperio


 
{code:java}
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
{code}
 
Run the above code will report an error:
{code:java}
org.apache.calcite.runtime.CalciteContextException: From line 1, column 8 to line 1, column 15: Table 'EXPR$1' not found
{code}
But if I assign an alias to the result of union all, it can be normal.
{code:java}
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;
{code}
 
 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)