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

Mihai Budiu commented on CALCITE-1440:
--------------------------------------

Supporting DAGs does not require supporting multiple roots, but I agree that in 
general you want multiple roots.

See Stamatis's talk at the last Calcite meetup: 
[https://www.youtube.com/watch?v=PHm5vZ1A43I] (last in the video).

He mentions the existing Spool operator which can be used to represent DAGs.

DAGs can arise from using CTEs or views.

Having good support for DAGs would also enable more sophisticated decorrelation 
algorithms to be implemented; if I understand right, decorrelation may require 
DAGs even if the original queries are trees.

> Implement planner for converting multiple SQL statements to unified RelNode 
> Tree
> --------------------------------------------------------------------------------
>
>                 Key: CALCITE-1440
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1440
>             Project: Calcite
>          Issue Type: New Feature
>            Reporter: Chinmay Kolhatkar
>            Assignee: TJ Banghart
>            Priority: Major
>
> This can be implemented as a separate planner or in {{VolcanoPlanner}} 
> itself. The planner should take multiple SQL statements as input and return a 
> unified {{RelNode}} tree.
> Example of above is as follows:
> {{SELECT COL1, COL2 FROM TABLE WHERE COL3 > 10;}}
> {{SELECT COL1, COL2 FROM TABLE WHERE COL4  = 'abc';}}
> The above 2 statements have a common path and hence can provide a unified 
> {{RelNode}} tree as follows:
> {noformat}
>  [Scan] -> [Project (COL1, COL2)] -> [Filter (COL4 = 'abc')] -> [Delta]
>                     |
>                     V
>             [Filter (COL3 > 10)]
>                     |
>                     v
>                  [Delta]
> {noformat}



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

Reply via email to