git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Created] (CALCITE-2278) AggregateJoinTransposeRule fails to split agg call for unique input with agg call


Haisheng Yuan created CALCITE-2278:
--------------------------------------

             Summary: AggregateJoinTransposeRule fails to split agg call for unique input with agg call
                 Key: CALCITE-2278
                 URL: https://issues.apache.org/jira/browse/CALCITE-2278
             Project: Calcite
          Issue Type: Bug
          Components: core
            Reporter: Haisheng Yuan
            Assignee: Julian Hyde


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)

```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)



( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/apache-calcite-development/msg03300.html on line 125
Call Stack
#TimeMemoryFunctionLocation
10.0006364760{main}( ).../msg03300.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/apache-calcite-development/msg03300.html on line 125
Call Stack
#TimeMemoryFunctionLocation
10.0006364760{main}( ).../msg03300.html:0