Kirill Tkalenko created CALCITE-7842:
----------------------------------------

             Summary: 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


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)

Reply via email to