[
https://issues.apache.org/jira/browse/CALCITE-4083?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Haisheng Yuan resolved CALCITE-4083.
------------------------------------
Fix Version/s: 1.24.0
Resolution: Fixed
Fixed in
[https://github.com/apache/calcite/commit/0769a8b31cbbeb5bca66ade30cf3710523da4aaa].
> RelTraitSet failed to canonize traits
> -------------------------------------
>
> Key: CALCITE-4083
> URL: https://issues.apache.org/jira/browse/CALCITE-4083
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Haisheng Yuan
> Priority: Major
> Fix For: 1.24.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> RelTraitSet#plus uses FlatLists and ImmutableList. They have different hash
> algorithms, and they are all different classes from RelTraitSet. The
> RelTraitSet equality requires the other object must be RelTraitSet too, and
> the HashMap#get(key) uses key.equals() to check equality, instead of the
> other way. In case we pass RelTraitSet as the search key to cache, but the
> cached entry has key with FlatLists or ImmutableList, we may fail to find the
> cached RelTraitSet. Due to this, using == to check traitSet equality may
> fail, even they have same traits.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)