[
https://issues.apache.org/jira/browse/CALCITE-6954?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stamatis Zampetakis updated CALCITE-6954:
-----------------------------------------
Issue Type: Bug (was: Improvement)
> 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
>
> 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)