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

AssertionError when case statement is used with optional value and literal using ReduceExpressionsRule

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.10.0
    • 1.11.0
    • core
    • None

    Description

      AssertionError when we use case with optional value and literal using ReduceExpressionsRule:

      SELECT CASE WHEN 1=2 THEN cast((values(1)) as integer) ELSE 2 end from (values(1))
      

      Stack trace:

      java.lang.AssertionError: Internal error: Cannot add expression of different type to set:
      set type is RecordType(INTEGER EXPR$0) NOT NULL
      expression type is RecordType(INTEGER NOT NULL EXPR$0) NOT NULL
      set is rel#14:LogicalProject(input=HepRelVertex#13,EXPR$0=CASE(=(1, 2), CAST($1):INTEGER, 2))
      expression is LogicalProject#16
      

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              sharnyk Serhii Harnyk
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: