Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.19.0
-
None
Description
RelOptRulesTest:
@Test public void testPushAggregateThroughJoinOnEmptyLogicalValuesError() { final HepProgram preProgram = new HepProgramBuilder() .addRuleInstance(AggregateProjectMergeRule.INSTANCE) .addRuleInstance(ReduceExpressionsRule.FilterReduceExpressionsRule.FILTER_INSTANCE) .build(); final HepProgram program = new HepProgramBuilder() .addRuleInstance(AggregateJoinTransposeRule.EXTENDED) .build(); final String sql = "select count(*) volume, sum(C1.sal) C1_sum_sal " + "from (select sal, ename from sales.emp where 1=2) C1 " + "inner join (select ename from sales.emp) C2 " + "on C1.ename = C2.ename "; sql(sql).withPre(preProgram).with(program).check(); }
Error:
java.lang.IllegalArgumentException: Cannot infer return type for *; operand types: [VARCHAR(20), BIGINT] at org.apache.calcite.sql.SqlOperator.inferReturnType(SqlOperator.java:474) at org.apache.calcite.rex.RexBuilder.deriveReturnType(RexBuilder.java:276) at org.apache.calcite.rex.RexBuilder.makeCall(RexBuilder.java:250) at org.apache.calcite.sql.SqlSplittableAggFunction$AbstractSumSplitter.topSplit(SqlSplittableAggFunction.java:298) at org.apache.calcite.rel.rules.AggregateJoinTransposeRule.onMatch(AggregateJoinTransposeRule.java:342) at org.apache.calcite.plan.AbstractRelOptPlanner.fireRule(AbstractRelOptPlanner.java:319) at org.apache.calcite.plan.hep.HepPlanner.applyRule(HepPlanner.java:559) at org.apache.calcite.plan.hep.HepPlanner.applyRules(HepPlanner.java:418) at org.apache.calcite.plan.hep.HepPlanner.executeInstruction(HepPlanner.java:255) at org.apache.calcite.plan.hep.HepInstruction$RuleInstance.execute(HepInstruction.java:127)
Attachments
Issue Links
- links to