[
https://issues.apache.org/jira/browse/CALCITE-3761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17028679#comment-17028679
]
Danny Chen commented on CALCITE-3761:
-------------------------------------
Sorry [~anjalishrishrimal], AFAIK, we do not support that dynamic now. The
pattern you suggested is not stable and deterministic.
Can you use the `ANY` operand for the intermediate operands and enumerate all
the operand patterns for all kinds of op tree level ?
> 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)