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

Ian Bertolacci commented on CALCITE-7237:
-----------------------------------------

> why would you even have UNORDERED with only 1 child?

We have a similar sentiment. The implication of pretty much all the docs is 
that this is specifically for > 1 operands.

> it seems that there's a mistake somehwere.

I looked up the history, and its been this way since the beginning of 
RelOptRuleOperand.

> Are there any other rules that use unordered today?

[Prune 
Empty|https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/rel/rules/PruneEmptyRules.java]




> RelOptRuleOperand Assertion error with UNORDERED child policy when more than 
> 1 child
> ------------------------------------------------------------------------------------
>
>                 Key: CALCITE-7237
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7237
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Ian Bertolacci
>            Priority: Major
>
> [In RelOptRuleOperand constructor, there is an assertion that if the policy 
> is UNORDERED, there must be exactly one 
> child.|https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperand.java#L124-L125]
> However, there are many paths to this condition which claim (both literally 
> in comments, or through accepting multiple operands) that there *can* be 
> multiple children.
> - 
> [RelRule.OperandDetailBuilder.unorderedInputs|https://calcite.apache.org/javadocAggregate/org/apache/calcite/plan/RelRule.OperandDetailBuilder.html#unorderedInputs(org.apache.calcite.plan.RelRule.OperandTransform...)]
> - 
> [RelRule.OperandDetailBuilderImpl.unorderedInputs|https://github.com/apache/calcite/blob/92a1028d65efc3005eb22c3def97adefd9e8f2fc/core/src/main/java/org/apache/calcite/plan/RelRule.java#L319-L324]
> - 
> [HepPlanner|https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java#L616]
> It seems like theres a contradiction here.



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

Reply via email to