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

Incorrect null semantic for ROW function

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core

      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

          Issue Links

            Activity

              People

              • Assignee:
                donnyzone Feng Zhu
                Reporter:
                donnyzone Feng Zhu
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

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