[
https://issues.apache.org/jira/browse/CALCITE-7842?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mihai Budiu resolved CALCITE-7842.
----------------------------------
Fix Version/s: 1.43.0
Resolution: Fixed
Fixed in
[https://github.com/apache/calcite/commit/7178b54f6d321eb59801ff3a88aa50af74678e06]
Thank you for the contribution [[email protected]]
> Multiset operators return incorrect results for ROW elements
> ------------------------------------------------------------
>
> Key: CALCITE-7842
> URL: https://issues.apache.org/jira/browse/CALCITE-7842
> Project: Calcite
> Issue Type: Bug
> Reporter: Kirill Tkalenko
> Assignee: Kirill Tkalenko
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.43.0
>
>
> Multiset operators compare {{ROW}} elements by reference rather than by field
> values, causing incorrect results for independently constructed equal rows.
> Affected operators: {{{}MEMBER OF{}}}, {{{}IS A SET{}}}, {{{}SUBMULTISET
> OF{}}}, {{{}MULTISET INTERSECT ALL/DISTINCT{}}}, {{{}MULTISET EXCEPT
> ALL/DISTINCT{}}}, and {{{}MULTISET UNION DISTINCT{}}}.
> {code:java}
> SELECT ROW(1, 'Foo') MEMBER OF MULTISET[ROW(x, y)] FROM (VALUES (1, 'Foo'),
> (2, 'Bar') ) AS t(x, y);{code}
> Expected: {{{}true{}}}, {{{}false{}}}.
> Actual: {{{}false{}}}, {{{}false{}}}.
> The runtime implementations use Java collection equality, which compares
> {{Object[]}} row values by reference.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)