Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.21.0
Description
When joining with a dimension table using the following 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
the unparsed sql is:
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`
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.
Attachments
Issue Links
- relates to
-
CALCITE-3620 Remove implicit lateral operator for temporal table join
- Closed
- links to