Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-20466

Table 'EXPR$1' not found with UNION ALL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 1.11.1
    • None
    • Table SQL / API

    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;
      

       
       

      Attachments

        Activity

          People

            Unassigned Unassigned
            wxmimperio wxmimperio
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: