You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Haisheng Yuan (JIRA)" <ji...@apache.org> on 2018/04/24 22:02:00 UTC
[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)