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

Incorrect null semantic for ROW function

    XMLWordPrintableJSON

Details

    Description

      In CALCITE-2464, an in-depth discussion on nullability of structured type has been conducted.
      According to SQL standards, a record's value (with structure type) is considered null if and only if all of its fields are null.
      Based on that, the ROW function's return type can be nullable.

      Moreover, current implementor for ROW function's NullPolicy (NullPolicy.ANY) contradicts its runtime behavior.

      Query: 
      select ROW(1, cast(null as int))
      
      Result:
      {1, null}

      However, according to the NullPolicy, the result should be null.

      Attachments

        Activity

          People

            donnyzone Feng Zhu
            donnyzone Feng Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

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