ververica / flink-sql-gateway

Apache License 2.0
490 stars 187 forks source link

Can't support temporal table join #58

Open zhiyuan192shine opened 4 years ago

zhiyuan192shine commented 4 years ago

SQL example:

CREATE VIEW v_inout_flow AS
SELECT tb.park_code,
       tb.park_name,
       tb.city_code,
       tb.city_name,
       ta.status,
       ta.event_time
  FROM ods_inout_flow AS ta
  JOIN dim_park FOR SYSTEM_TIME AS OF ta.proctime AS tb
    ON ta.org_code = tb.org_code;

The exception is:

Caused by: org.apache.flink.table.api.SqlParserException: SQL parse failed. Encountered "`dim_park`" at line 3, column 20.
Was expecting one of:
    "TABLE" ...
    "(" ...

    at org.apache.flink.table.planner.calcite.CalciteParser.parse(CalciteParser.java:50)
    at org.apache.flink.table.planner.delegation.ParserImpl.parse(ParserImpl.java:64)
    at org.apache.flink.table.api.internal.TableEnvironmentImpl.sqlQuery(TableEnvironmentImpl.java:464)
    at com.ververica.flink.table.gateway.operation.CreateViewOperation.lambda$execute$0(CreateViewOperation.java:57)
    at com.ververica.flink.table.gateway.context.ExecutionContext.wrapClassLoader(ExecutionContext.java:204)
    at com.ververica.flink.table.gateway.operation.CreateViewOperation.execute(CreateViewOperation.java:56)
    ... 45 more