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

anjali shrishrimal commented on CALCITE-3761:
---------------------------------------------

Thank you [~danny0405] for the information.

But I couldn't find any example/rule where ANY is used for intermediate 
operand. ANY is always used at the end.

Can you provide a sample example, showing how to use ANY for intermediate 
operand?

 

Also, what will be the impact of using ANY multiple times for intermediate 
operands on performance?

Looking forward to your advice, many thanks!

 

> How to write a rule with optional intermediate operands?
> --------------------------------------------------------
>
>                 Key: CALCITE-3761
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3761
>             Project: Calcite
>          Issue Type: Wish
>          Components: core
>            Reporter: anjali shrishrimal
>            Priority: Trivial
>
> I want to write a rule to match a plan based on, only root/top RelNode and 
> leaf RelNode, all Intermediate RelNodes are optional.
> What operands should be passed to such rule?
>  
> Suppose Logical Plan is like given below.
> {code:java}
> LogicalRelNode4
>      LogicalRelNode3 (optional)
>          LogicalRelNode2 (optional)
>               LogicalRelNode1
> {code}
> LogicalRelNode2 and LogicalRelNode3 are optional. Rule should match the 
> structure irrespective to the presence of these optional Nodes.
> Rule should get matched for all the following structures.
> {code:java}
> 1. LogicalRelNode4
>         LogicalRelNode3
>              LogicalRelNode2
>                   LogicalRelNode1 
> 2. LogicalRelNode4 
>         LogicalRelNode2 
>              LogicalRelNode1
> 3. LogicalRelNode4 
>         LogicalRelNode3 
>              LogicalRelNode1 
> 4. LogicalRelNode4 
>         LogicalRelNode1
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to