You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/12/17 03:48:00 UTC
[jira] [Updated] (CALCITE-3603) SqlLateralOperator's unparse add
additional keyword 'LATERAL' when the inner operator is SqlSnapshot
[ https://issues.apache.org/jira/browse/CALCITE-3603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated CALCITE-3603:
------------------------------------
Labels: pull-request-available (was: )
> 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
> Priority: Minor
> Labels: pull-request-available
>
> 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)