[ 
https://issues.apache.org/jira/browse/CALCITE-7196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18022307#comment-18022307
 ] 

Julian Hyde commented on CALCITE-7196:
--------------------------------------

Can you give an example SQL query that would benefit from this rewrite rule?

> Create an optimization pass which can convert some cases of Correlate + 
> Unnest to Unnest
> ----------------------------------------------------------------------------------------
>
>                 Key: CALCITE-7196
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7196
>             Project: Calcite
>          Issue Type: New Feature
>          Components: core
>    Affects Versions: 1.40.0
>            Reporter: Mihai Budiu
>            Assignee: Mihai Budiu
>            Priority: Minor
>
> Today UNNEST is always compiled into a Correlate + Unnest.
> Some query plans of this shape can be simplified however:
> {code}
> Project
>    Correlate
>       LeftInput
>       Uncollect
>          Project(correlatedVariable) // only one field here
>            Values
> {code}
> If the Project only preserves fields from the right-side of the Correlate, 
> such plans can be rewritten as 
> {code}
> Project
>    Uncollect
>      LeftInput
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to