Description
For the following query:
select A.job, B.mgr, A.deptno, max(B.hiredate1) as hiredate1, sum(B.comm1) as comm1 from sales.emp as A join (select mgr, sal, max(hiredate) as hiredate1, sum(comm) as comm1 from sales.emp group by mgr, sal) as B on A.sal=B.sal group by A.job, B.mgr, A.deptno
Exception is thrown out:
java.lang.IndexOutOfBoundsException: index (7) must be less than size (6) at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:310) at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:293) at com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:67) at org.apache.calcite.sql.SqlSplittableAggFunction$AbstractSumSplitter.topSplit(SqlSplittableAggFunction.java:246) at org.apache.calcite.rel.rules.AggregateJoinTransposeRule.onMatch(AggregateJoinTransposeRule.java:332) at org.apache.calcite.plan.AbstractRelOptPlanner.fireRule(AbstractRelOptPlanner.java:317) at org.apache.calcite.plan.hep.HepPlanner.applyRule(HepPlanner.java:556) at org.apache.calcite.plan.hep.HepPlanner.applyRules(HepPlanner.java:415) at org.apache.calcite.plan.hep.HepPlanner.executeInstruction(HepPlanner.java:252) at org.apache.calcite.plan.hep.HepInstruction$RuleInstance.execute(HepInstruction.java:127) at org.apache.calcite.plan.hep.HepPlanner.executeProgram(HepPlanner.java:211) at org.apache.calcite.plan.hep.HepPlanner.findBestExp(HepPlanner.java:198) at org.apache.calcite.test.RelOptTestBase.checkPlanning(RelOptTestBase.java:170)