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

The type derived for a cast to INT ARRAY always has non-nullable elements

    XMLWordPrintableJSON

Details

    Description

      Consider an expression such as SELECT CAST(variant AS INT ARRAY).
      The type inference produces a type of INTEGER NOT NULL ARRAY.
      This is incorrect, since the elements of the array could be nulls.
      This happens because SqlCollectionTypeNameSpec.deriveType never produces nullable types for collection elements.
      Notice that one cannot write INT NULL ARRAY or INT NOT NULL ARRAY.
      A conservative implementation should always produce a nullable element type.

      Attachments

        Issue Links

          Activity

            People

              mbudiu Mihai Budiu
              mbudiu Mihai Budiu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: