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

SqlTypeFactoryImpl#leastRestrictive returns non-canonical collection types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.39.0
    • 1.40.0
    • None

    Description

      SqlTypeFactoryImpl#leastRestrictive method creates non-canonical types when it passes through:

      • leastRestrictiveArrayMultisetType
      • leastRestrictiveMapType

      The behavior violates the contract of the RelDataTypeFactory (see below) and creates problems since many places in the code compare RelDataType and rely on the object equality.

      The Javadoc of the RelDataTypeFactory states the following:

       * Any implementation of <code>RelDataTypeFactory</code> must ensure that type
       * objects are canonical: two types are equal if and only if they are
       * represented by the same Java object. This reduces memory consumption and
       * comparison cost.
      

      Attachments

        Issue Links

          Activity

            People

              zabetak Stamatis Zampetakis
              zabetak Stamatis Zampetakis
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: