jackylau created FLINK-19950:
--------------------------------
Summary: LookupJoin can not support view or subquery and so on. o
Key: FLINK-19950
URL:
https://issues.apache.org/jira/browse/FLINK-19950 Project: Flink
Issue Type: Bug
Components: Table SQL / Planner
Affects Versions: 1.11.0
Reporter: jackylau
Fix For: 1.12.0
{code:java}
// 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}
{code:java}
// 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);
}
{code}
it will exist cast Exception at final TableScan scan = (TableScan) bb.root;
--
This message was sent by Atlassian Jira
(v8.3.4#803005)