[
https://issues.apache.org/jira/browse/CALCITE-6076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17779891#comment-17779891
]
hongyu guo commented on CALCITE-6076:
-------------------------------------
I have dug into the code and git history and found that CALCITE-1309 provides a
solution by simply using the LATERAL TABLE keyword.
I will close this case.
> Table function can not refer other table columns
> ------------------------------------------------
>
> Key: CALCITE-6076
> URL: https://issues.apache.org/jira/browse/CALCITE-6076
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.35.0
> Reporter: hongyu guo
> Assignee: hongyu guo
> Priority: Major
>
> SQL
> {code:java}
> select rmp.i from emp, table(ramp(emp.deptno)) as rmp {code}
> will throw an error:
> {code:java}
> Table 'EMP' not found {code}
> during the validation.
> this SQL fails because the scope of the table function during the validation
> is {{{}CatalogScope{}}}, not {{{}JoinScope{}}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)