[
https://issues.apache.org/jira/browse/CALCITE-7217?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sergey Nuyanzin updated CALCITE-7217:
-------------------------------------
Description:
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}
was:
It looks like usage of {{SqlValidatorImpl#validate}} for queries with
{{LATERAL}} leads to it's losing.
simple 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 it to
{code:sql}
SELECT *
FROM `EMP`,
TABLE(RAMP(`EMP`.`DEPTNO`)),
`DEPT`
{code}
> 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
>
> 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)