Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-9132 CBO: Calcite Operator To Hive Operator (Calcite Return Path)
  3. HIVE-10341

CBO (Calcite Return Path): TraitSets not correctly propagated in HiveSortExchange causes Assertion error

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • cbo-branch
    • cbo-branch
    • CBO
    • None

    Description

      When return path is on (hive.cbo.returnpath.hiveop=true), the TraitSets are not correctly set up by HiveSortExchange. For instance, correlationoptimizer14.q produces the following exception:

      Unexpected exception java.lang.AssertionError: traits=NONE.[], collation=[0]
       at org.apache.calcite.rel.core.SortExchange.<init>(SortExchange.java:63)
       at org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveSortExchange.<init>(HiveSortExchange.java:18)
       at org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveSortExchange.create(HiveSortExchange.java:39)
       at org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveInsertExchange4JoinRule.onMatch(HiveInsertExchange4JoinRule.java:95)
       at org.apache.calcite.plan.AbstractRelOptPlanner.fireRule(AbstractRelOptPlanner.java:326)
       at org.apache.calcite.plan.hep.HepPlanner.applyRule(HepPlanner.java:515)
       at org.apache.calcite.plan.hep.HepPlanner.applyRules(HepPlanner.java:392)
       at org.apache.calcite.plan.hep.HepPlanner.executeInstruction(HepPlanner.java:255)
       at org.apache.calcite.plan.hep.HepInstruction$RuleInstance.execute(HepInstruction.java:125)
       at org.apache.calcite.plan.hep.HepPlanner.executeProgram(HepPlanner.java:207)
       at org.apache.calcite.plan.hep.HepPlanner.findBestExp(HepPlanner.java:194)
      ...
      

      Attachments

        1. HIVE-10341.cbo.patch
          1 kB
          jcamachorodriguez

        Activity

          People

            jcamacho Jesús Camacho Rodríguez
            jcamacho Jesús Camacho Rodríguez
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: