You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "anjali shrishrimal (Jira)" <ji...@apache.org> on 2020/01/31 06:59:00 UTC

[jira] [Created] (CALCITE-3761) How to write a rule with optional intermediate operands?

anjali shrishrimal created CALCITE-3761:
-------------------------------------------

             Summary: 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


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)