[
https://issues.apache.org/jira/browse/CALCITE-3603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17000792#comment-17000792
]
Danny Chen commented on CALCITE-3603:
-------------------------------------
Have fire a fix in CALCITE-3620 :)
> SqlLateralOperator's unparse add additional keyword 'LATERAL' when the inner
> operator is SqlSnapshot
> ----------------------------------------------------------------------------------------------------
>
> Key: CALCITE-3603
> URL: https://issues.apache.org/jira/browse/CALCITE-3603
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.21.0
> Reporter: Kevin Zhang
> Assignee: Danny Chen
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.22.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> When joining with a dimension table using the following sql
> {code:sql}
> SELECT
> o.amout, o.currency, r.rate, o.amount * r.rate
> FROM
> Orders AS o
> JOIN LatestRates FOR SYSTEM_TIME AS OF o.proctime AS r
> ON r.currency = o.currency
> {code}
> the unparsed sql is:
> {code:sql}
> SELECT `o`.`amout`, `o`.`currency`, `r`.`rate`, `o`.`amount` * `r`.`rate`
> FROM `Orders` AS `o`
> INNER JOIN LATERAL `LatestRates` FOR SYSTEM_TIME AS OF `o`.`proctime` AS `r`
> ON `r`.`currency` = `o`.`currency`
> {code}
> which has a syntax error because an additional "LATERAL" is added after
> "JOIN".
> The problem lies in SqlLateralOperator's unparse method, if the kind of the
> first operand is SqlSnapshot, we should not write out the operator's name.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)