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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.10.0
    • Fix Version/s: 1.11.0
    • Component/s: core
    • Labels:
      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
      

        Issue Links

          Activity

          Hide
          sharnyk Serhii Harnyk added a comment -

          I have created pull request to this Jira: https://github.com/apache/calcite/pull/328.

          Show
          sharnyk Serhii Harnyk added a comment - I have created pull request to this Jira: https://github.com/apache/calcite/pull/328 .
          Hide
          julianhyde Julian Hyde added a comment -
          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/9b62ab3d . Serhii Harnyk , thanks for the PR!
          Hide
          julianhyde Julian Hyde added a comment -

          Resolved in release 1.11.0 (2017-01-11).

          Show
          julianhyde Julian Hyde added a comment - Resolved in release 1.11.0 (2017-01-11).

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development