Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-20913

Narrowing nullability may cause typecheck failures

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      CALCITE-1413 have added a logic to narrow an expression's type from nullable to non-nullable - this causes some issues for Hive side sanity checks.

      can be reproduced with a calcite 1.18.0-SNAPSHOT ; and -Dtest=TestCliDriver#*[semijoin5]

      java.lang.AssertionError: 
      Cannot add expression of different type to set:
      set type is RecordType(INTEGER int_col, INTEGER int_col_1, BIGINT float_col, BIGINT int_col_2) NOT NULL
      expression type is RecordType(INTEGER NOT NULL int_col, INTEGER int_col_1, BIGINT float_col, BIGINT int_col_2) NOT NULL
      set is rel#202:HiveProject.HIVE.[](input=HepRelVertex#201,int_col=CASE(IS NOT NULL(498), 498, IS NOT NULL($116), $116, 524),int_col_1=+($99, CAST($49):INTEGER),float_col=FLOOR($15),int_col_2=CASE(IS NOT NULL($117), $117, 704))
      expression is HiveProject#289
      	at org.apache.calcite.plan.RelOptUtil.verifyTypeEquivalence(RelOptUtil.java:381)
      	at org.apache.calcite.plan.hep.HepRuleCall.transformTo(HepRuleCall.java:57)
      	at org.apache.calcite.plan.RelOptRuleCall.transformTo(RelOptRuleCall.java:234)
      	at org.apache.calcite.rel.rules.ReduceExpressionsRule$ProjectReduceExpressionsRule.onMatch(ReduceExpressionsRule.java:291)
      	at org.apache.calcite.plan.AbstractRelOptPlanner.fireRule(AbstractRelOptPlanner.java:319)
      	at org.apache.calcite.plan.hep.HepPlanner.applyRule(HepPlanner.java:559)
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kgyrtkirk Zoltan Haindrich
                Reporter:
                kgyrtkirk Zoltan Haindrich
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: