Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
select sum(sal) from (select * from sales.emp where empno = 10) as e join sales.dept as d on e.job = d.name
AggregateJoinTransposeRule will broken when process the above sql, thrown exception is
java.lang.AssertionError: type mismatch: aggCall type: INTEGER inferred type: INTEGER NOT NULL at org.apache.calcite.util.Litmus$1.fail(Litmus.java:31) at org.apache.calcite.plan.RelOptUtil.eq(RelOptUtil.java:1838) at org.apache.calcite.rel.core.Aggregate.typeMatchesInferred(Aggregate.java:428) at org.apache.calcite.rel.core.Aggregate.<init>(Aggregate.java:161) at org.apache.calcite.rel.logical.LogicalAggregate.<init>(LogicalAggregate.java:65) at org.apache.calcite.rel.logical.LogicalAggregate.create_(LogicalAggregate.java:110) at org.apache.calcite.rel.logical.LogicalAggregate.create(LogicalAggregate.java:100) at org.apache.calcite.rel.core.RelFactories$AggregateFactoryImpl.createAggregate(RelFactories.java:213) at org.apache.calcite.tools.RelBuilder.aggregate(RelBuilder.java:1267) at org.apache.calcite.tools.RelBuilder.aggregate(RelBuilder.java:1825) at org.apache.calcite.rel.rules.AggregateJoinTransposeRule.onMatch(AggregateJoinTransposeRule.java:260)
Attachments
Issue Links
- is related to
-
CALCITE-2108 AggregateJoinTransposeRule fails when process aggregateCall above SqlSumEmptyIsZeroAggFunction without groupKeys
- Closed