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

Least restrictive type among structs does not consider nullability

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.20.0
    • Component/s: None

      Description

      Consider the following high-level example:

      CREATE TYPE Coordinates AS (
        x INT,
        y INT);
      
      CREATE TABLE Address (
        loc1 Coordinates NOT NULL,
        loc2 Coordinates)
      

      The least restrictive type between loc1 and loc2 is the type of loc2 (i.e., a nullable Coordinates type).

      The existing code (i.e., RelDataTypeFactory#leastRestrictive) does take into account nullability when the type is structured type (or row type).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                zabetak Stamatis Zampetakis
                Reporter:
                zabetak Stamatis Zampetakis
              • 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 - 50m
                  50m