Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3020

throws AssertionError:Type mismatch in VolcanoPlanner

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.19.0
    • Fix Version/s: 1.20.0
    • Component/s: core
    • Labels:
      None

      Description

      after CALCITE-2454 merged, an AssertionError:Type mismatch will be thrown in VolcanoPlanner when running the following sql:

      WITH t1 AS (SELECT CAST(a as BIGINT) AS a, SUM(b) AS b FROM x GROUP BY CAST(a as BIGINT)),
           t2 AS (SELECT CAST(a as DOUBLE) AS a, SUM(b) AS b FROM x GROUP BY CAST(a as DOUBLE))
      SELECT t1.*, t2.* FROM t1, t2 WHERE t1.b = t2.b
      

      Caused by: java.lang.AssertionError: Type mismatch:
      left:
      RecordType(BIGINT a, BIGINT b) NOT NULL
      right:
      RecordType(DOUBLE a, BIGINT b) NOT NULL
      at org.apache.calcite.util.Litmus$1.fail(Litmus.java:31)
      at org.apache.calcite.plan.RelOptUtil.equal(RelOptUtil.java:1858)
      at org.apache.calcite.plan.volcano.VolcanoPlanner.registerImpl(VolcanoPlanner.java:1705)
      at org.apache.calcite.plan.volcano.VolcanoPlanner.register(VolcanoPlanner.java:850)
      at org.apache.calcite.plan.volcano.VolcanoPlanner.ensureRegistered(VolcanoPlanner.java:872)
      at org.apache.calcite.plan.volcano.VolcanoPlanner.ensureRegistered(VolcanoPlanner.java:1958)
      at org.apache.calcite.plan.volcano.VolcanoRuleCall.transformTo(VolcanoRuleCall.java:126)
      at org.apache.calcite.plan.RelOptRuleCall.transformTo(RelOptRuleCall.java:234)
      at org.apache.calcite.rel.convert.ConverterRule.onMatch(ConverterRule.java:141)
      at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:205)
      at org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:637)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                danny0405 Danny Chen
                Reporter:
                godfreyhe godfrey he
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: