[
https://issues.apache.org/jira/browse/CALCITE-7217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18028585#comment-18028585
]
Sergey Nuyanzin commented on CALCITE-7217:
------------------------------------------
Fixed in
https://github.com/apache/calcite/commit/5ff16687289b6279b6b5bcf12d2e3ddd12a2c9e9
Thank you for the review [~mbudiu], [~caicancai]
> LATERAL is lost after validation
> --------------------------------
>
> Key: CALCITE-7217
> URL: https://issues.apache.org/jira/browse/CALCITE-7217
> Project: Calcite
> Issue Type: Bug
> Reporter: Sergey Nuyanzin
> Assignee: Sergey Nuyanzin
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.41.0
>
>
> It looks like usage of {{SqlValidatorImpl#validate}} for queries with
> {{LATERAL}} leads to it's losing.
> an example
> {code:java}
> sql("select * from emp, lateral table(ramp(emp.deptno)), dept")
> .rewritesTo("SELECT *\n"
> + "FROM `EMP`,\n"
> + "LATERAL TABLE(RAMP(`EMP`.`DEPTNO`)),\n"
> + "`DEPT`");
> {code}
> this will fail since currently it rewrites it to
> {code:sql}
> SELECT *
> FROM `EMP`,
> TABLE(RAMP(`EMP`.`DEPTNO`)),
> `DEPT`
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)