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

LookupJoin can not support view or subquery and so on. o

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 1.11.0
    • None
    • Table SQL / Planner
    • None

    Description

      // code placeholder
      val sql0 = "create view v1 AS SELECT * FROM user_table"
      
      val sql = "SELECT T.id, T.len, T.content, D.name FROM src AS T JOIN v1 " +
        "for system_time as of T.proctime AS D ON T.id = D.id"
      
      val sink = new TestingAppendSink
      tEnv.executeSql(sql0)
      tEnv.sqlQuery(sql).toAppendStream[Row].addSink(sink)
      env.execute()
      
      // code placeholder
      private void convertTemporalTable(Blackboard bb, SqlCall call) {
        final SqlSnapshot snapshot = (SqlSnapshot) call;
        final RexNode period = bb.convertExpression(snapshot.getPeriod());
      
        // convert inner query, could be a table name or a derived table
        SqlNode expr = snapshot.getTableRef();
        convertFrom(bb, expr);
        final TableScan scan = (TableScan) bb.root;
      
        final RelNode snapshotRel = relBuilder.push(scan).snapshot(period).build();
      
        bb.setRoot(snapshotRel, false);
      }
      
      

      it will exist cast Exception at final TableScan scan = (TableScan) bb.root;

       

      java.lang.ClassCastException:

      class org.apache.calcite.rel.logical.LogicalProject cannot be cast to class org.apache.calcite.rel.core.TableScan (org.apache.calcite.rel.logical.LogicalProject and org.apache.calcite.rel.core.TableScan are in unnamed module of loader 'app')

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jackylau Jacky Lau
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: