[
https://issues.apache.org/jira/browse/FLINK-20307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17237976#comment-17237976
]
Dawid Wysakowicz commented on FLINK-20307:
------------------------------------------
My bad. Sorry for the confusion. I will take a look at the updated docs.
> Strength the document about temporal table join syntax
> ------------------------------------------------------
>
> Key: FLINK-20307
> URL: https://issues.apache.org/jira/browse/FLINK-20307
> Project: Flink
> Issue Type: Improvement
> Components: Documentation, Table SQL / Planner
> Reporter: Dawid Wysakowicz
> Assignee: Danny Chen
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.12.0
>
>
> A query like:
> {code}
> SELECT p.name, p.qty * r.rate AS price, p.`tstamp` FROM Products p JOIN
> versioned_rates r FOR SYSTEM_TIME AS OF p.`tstamp` ON p.currency = r.currency;
> {code}
> fails with:
> {code}
> [ERROR] Could not execute SQL statement. Reason:
> org.apache.flink.sql.parser.impl.ParseException: Encountered "FOR" at line 1,
> column 108.
> Was expecting one of:
> <EOF>
> "EXCEPT" ...
> "FETCH" ...
> "GROUP" ...
> "HAVING" ...
> "INTERSECT" ...
> "LIMIT" ...
> "OFFSET" ...
> "ON" ...
> "ORDER" ...
> "MINUS" ...
> "TABLESAMPLE" ...
> "UNION" ...
> "USING" ...
> "WHERE" ...
> "WINDOW" ...
> "(" ...
> "NATURAL" ...
> "JOIN" ...
> "INNER" ...
> "LEFT" ...
> "RIGHT" ...
> "FULL" ...
> "CROSS" ...
> "," ...
> "OUTER" ...
> {code}
> When I do not alias the {{versioned_rates}} table everything works as
> expected. Therefore query like just runs:
> {code}
> SELECT p.name, p.qty * versioned_rates.rate AS price, p.`tstamp` FROM
> Products p JOIN versioned_rates FOR SYSTEM_TIME AS OF p.`tstamp` ON
> p.currency = versioned_rates.currency;
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)