[
https://issues.apache.org/jira/browse/CALCITE-5420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17644138#comment-17644138
]
James Starr commented on CALCITE-5420:
--------------------------------------
[~libenchao] The hard one is joins, but maybe how the correlate id is being
bound to the scope is not the correct abstraction. Most rules and other
utilities(such as the trimmer) do pass the correlate id through correctly. If
the correlate id was stored in the subquery along with explicit references to
binding for correlated variables, then almost all the rules and utilities would
just work.
> SqlToRel should populate projects corralate id for queries with aggregates.
> ---------------------------------------------------------------------------
>
> Key: CALCITE-5420
> URL: https://issues.apache.org/jira/browse/CALCITE-5420
> Project: Calcite
> Issue Type: Bug
> Reporter: James Starr
> Assignee: James Starr
> Priority: Major
>
> The following query does not populate correlate id in the project when
> SqlToRel.expand=false:
> {code:sql}
> SELECT SUM(
> (select char_length(dname) from "scott".dept where dept.deptno =
> emp.empno)) as s
> FROM "scott".emp
> {code}
> Having the correlate id populated is important for expanding nested queries.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)