calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Haidai (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CALCITE-3076) Error when AggregateJoinTransposeRule is used on empty LogicalValues
Date Fri, 17 May 2019 15:52:00 GMT
Anton Haidai created CALCITE-3076:
-------------------------------------

             Summary: Error when AggregateJoinTransposeRule is used on empty LogicalValues
                 Key: CALCITE-3076
                 URL: https://issues.apache.org/jira/browse/CALCITE-3076
             Project: Calcite
          Issue Type: Bug
    Affects Versions: 1.19.0
            Reporter: Anton Haidai


RelOptRulesTest:
{code}
  @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_max_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();
  }
{code}

Error:
{code}
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)
{code}



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

Mime
View raw message