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

When subquery include NULL value, Calcite should return the right result

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

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

    Description

      When I try to design some unit tests for CALCITE-4742. I found Calcite can't handle NULL very well in some subquery.

      For example: 

      select 1 in (values(null),(null))
      ERROR:
          java.lang.AssertionError: Conversion to relational algebra failed to preserve datatypes:
          validated type:
          RecordType(BOOLEAN NOT NULL EXPR$0) NOT NULL
          converted type:
          RecordType(BOOLEAN EXPR$0) NOT NULL
          rel:
          LogicalProject(EXPR$0=[IN(1, {
          LogicalValues(tuples=[[{ null }]])
          })])
            LogicalValues(tuples=[[{ 0 }]])
      select 1 > some(values(null),(null))
      ERROR:
          Suppressed: java.lang.RuntimeException: while resolving method 'voidValue' in class class java.lang.Void

      This SQL should return NULL. But throw the runtime exception.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            nobigo xiong duan
            nobigo xiong duan

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 10m
                10m

                Slack

                  Issue deployment