Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1544

AggregateJoinTransposeRule fails to preserve row type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.12.0
    • None
    • None

    Description

      Here is the sql to reproduce the failure:

      select e.deptno
      from sales.emp as e join sales.dept as d on e.deptno = d.deptno
      group by e.deptno
      

      After push the aggregator past join, the RowType seems been changed, and gives the following error:

      java.lang.AssertionError: Internal error: Cannot add expression of different type to set:
      set type is RecordType(INTEGER NOT NULL DEPTNO, INTEGER NOT NULL DEPTNO0) NOT NULL
      expression type is RecordType(INTEGER NOT NULL DEPTNO, INTEGER NOT NULL DEPTNO0, VARCHAR(10) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" NOT NULL NAME) NOT NULL
      set is rel#20:LogicalAggregate(input=HepRelVertex#19,group={7, 9})
      expression is LogicalJoin#23
      
      	at org.apache.calcite.util.Util.newInternal(Util.java:780)
      	at org.apache.calcite.plan.RelOptUtil.verifyTypeEquivalence(RelOptUtil.java:384)
      	at org.apache.calcite.plan.hep.HepRuleCall.transformTo(HepRuleCall.java:57)
      	at org.apache.calcite.plan.RelOptRuleCall.transformTo(RelOptRuleCall.java:225)
      	at org.apache.calcite.rel.rules.AggregateJoinTransposeRule.onMatch(AggregateJoinTransposeRule.java:342)
      

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              ykt836 Kurt Young
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: