You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Chunwei Lei (Jira)" <ji...@apache.org> on 2020/10/30 08:49:00 UTC

[jira] [Commented] (CALCITE-4368) TopDownOptTest fails if applying non-substitution rule first

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

Chunwei Lei commented on CALCITE-4368:
--------------------------------------

[~FatLittle], could you please help review the PR? Thank you.

> TopDownOptTest fails if applying non-substitution rule first
> ------------------------------------------------------------
>
>                 Key: CALCITE-4368
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4368
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Chunwei Lei
>            Assignee: Chunwei Lei
>            Priority: Major
>
> If we apply non-substitution rules first, some tests in TopDownOptTest would fail and it's not supposed to be. It can be reproduced by the following change: 
> {code:java}
> // TopDownRuleQueue.java
> private void addMatch(VolcanoRuleMatch match, Deque<VolcanoRuleMatch> queue) {
>   if (!names.add(match.toString())) {
>     return;
>   }
>   if (planner.isSubstituteRule(match)) { // change this line
>     queue.addFirst(match);
>   } else {
>     queue.addLast(match);
>   }
> }
> {code}
> The error message is: 
> {code:java}
> java.lang.AssertionError 
> at org.apache.calcite.adapter.enumerable.EnumerableMergeJoin.<init>(EnumerableMergeJoin.java:75) 
> at org.apache.calcite.adapter.enumerable.EnumerableMergeJoin.copy(EnumerableMergeJoin.java:380) 
> at org.apache.calcite.adapter.enumerable.EnumerableMergeJoin.copy(EnumerableMergeJoin.java:65) 
> at org.apache.calcite.rel.core.Join.copy(Join.java:310) at org.apache.calcite.rel.core.Join.copy(Join.java:59) 
> at org.apache.calcite.rel.PhysicalNode.passThrough(PhysicalNode.java:88) at org.apache.calcite.plan.volcano.RelSubset.passThrough(RelSubset.java:474) 
> at org.apache.calcite.plan.volcano.TopDownRuleDriver.convert(TopDownRuleDriver.java:582) at org.apache.calcite.plan.volcano.TopDownRuleDriver.getOptimizeInputTask(TopDownRuleDriver.java:547) 
> at org.apache.calcite.plan.volcano.TopDownRuleDriver.access$400(TopDownRuleDriver.java:49) at org.apache.calcite.plan.volcano.TopDownRuleDriver$OptimizeGroup.perform(TopDownRuleDriver.java:349) at org.apache.calcite.plan.volcano.TopDownRuleDriver.drive(TopDownRuleDriver.java:103) 
> at org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:520) 
> at org.apache.calcite.test.RelOptTestBase.checkPlanning(RelOptTestBase.java:122) at org.apache.calcite.test.RelOptTestBase.access$000(RelOptTestBase.java:64)
>  at org.apache.calcite.test.RelOptTestBase$Sql.check(RelOptTestBase.java:303) at org.apache.calcite.test.RelOptTestBase$Sql.check(RelOptTestBase.java:282) 
> at org.apache.calcite.test.Query.check(TopDownOptTest.java:824) at org.apache.calcite.test.TopDownOptTest.testSortMergeJoin(TopDownOptTest.java:100)  
> {code}



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