[ 
https://issues.apache.org/jira/browse/CALCITE-6954?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mihai Budiu resolved CALCITE-6954.
----------------------------------
    Fix Version/s: 1.40.0
       Resolution: Fixed

Fixed in 
https://github.com/apache/calcite/commit/021b3c35fcefec48957f4f32adb26146f14971ff
Thank you for the fix [~zabetak].
Thank you all the reviewers

> SqlTypeFactoryImpl#leastRestrictive returns non-canonical collection types
> --------------------------------------------------------------------------
>
>                 Key: CALCITE-6954
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6954
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.39.0
>            Reporter: Stamatis Zampetakis
>            Assignee: Stamatis Zampetakis
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.40.0
>
>
> 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:
> {code:java}
>  * 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.
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to