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

Check if HepPlanner should allow to register non-nullable column as an equivalent to nullable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.26.0
    • None
    • core
    • None

    Description

      org.apache.calcite.test.RelOptRulesTest#testReduceNullableToNotNull2

      java.lang.AssertionError: Cannot add expression of different type to set:
      set type is RecordType(INTEGER NEWCOL) NOT NULL
      expression type is RecordType(INTEGER NOT NULL NEWCOL) NOT NULL
      set is rel#9105:LogicalProject.(input=HepRelVertex#9104,exprs=[+($0, CASE(=('a', 'a'), 1, null:INTEGER))])
      expression is LogicalProject(NEWCOL=[+($0, 1)])
        LogicalTableScan(table=[[CATALOG, SALES, EMP]])
      
      	at org.apache.calcite.plan.RelOptUtil.verifyTypeEquivalence(RelOptUtil.java:380)
      	at org.apache.calcite.plan.hep.HepRuleCall.transformTo(HepRuleCall.java:58)
      	at org.apache.calcite.plan.RelOptRuleCall.transformTo(RelOptRuleCall.java:268)
      	at org.apache.calcite.plan.RelOptRuleCall.transformTo(RelOptRuleCall.java:283)
      	at org.apache.calcite.rel.rules.ReduceExpressionsRule$ProjectReduceExpressionsRule.onMatch(ReduceExpressionsRule.java:310)
      	at org.apache.calcite.plan.AbstractRelOptPlanner.fireRule(AbstractRelOptPlanner.java:333)
      	at org.apache.calcite.plan.hep.HepPlanner.applyRule(HepPlanner.java:542)
      	at org.apache.calcite.plan.hep.HepPlanner.applyRules(HepPlanner.java:407)
      	at org.apache.calcite.plan.hep.HepPlanner.executeInstruction(HepPlanner.java:243)
      	at org.apache.calcite.plan.hep.HepInstruction$RuleInstance.execute(HepInstruction.java:127)
      	at org.apache.calcite.plan.hep.HepPlanner.executeProgram(HepPlanner.java:202)
      	at org.apache.calcite.plan.hep.HepPlanner.findBestExp(HepPlanner.java:189)
      	at org.apache.calcite.test.RelOptTestBase.checkPlanning(RelOptTestBase.java:122)
      	at org.apache.calcite.test.RelOptTestBase.access$000(RelOptTestBase.java:64)
      	at org.apache.calcite.test.RelOptTestBase$Sql.check(RelOptTestBase.java:303)
      	at org.apache.calcite.test.RelOptTestBase$Sql.check(RelOptTestBase.java:282)
      	at org.apache.calcite.test.RelOptRulesTest.checkReduceNullableToNotNull(RelOptRulesTest.java:2854)
      	at org.apache.calcite.test.RelOptRulesTest.testReduceNullableToNotNull2(RelOptRulesTest.java:2871)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vladimirsitnikov Vladimir Sitnikov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: