You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2018/05/21 20:21:00 UTC

[jira] [Updated] (CALCITE-2278) AggregateJoinTransposeRule fails to split aggregate call if input contains an aggregate call and has distinct rows

     [ https://issues.apache.org/jira/browse/CALCITE-2278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Hyde updated CALCITE-2278:
---------------------------------
    Summary: AggregateJoinTransposeRule fails to split aggregate call if input contains an aggregate call and has distinct rows  (was: AggregateJoinTransposeRule fails to split agg call for unique input with agg call)

> AggregateJoinTransposeRule fails to split aggregate call if input contains an aggregate call and has distinct rows
> ------------------------------------------------------------------------------------------------------------------
>
>                 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
>            Priority: Major
>
> For the following query:
> {code:java}
> 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{code}
>  
> Exception is thrown out: 
> {noformat}
> 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)
>  
> {noformat}
>  



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