[
https://issues.apache.org/jira/browse/CALCITE-7836?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mihai Budiu resolved CALCITE-7836.
----------------------------------
Fix Version/s: 1.43.0
Resolution: Fixed
Fixed in
[https://github.com/apache/calcite/commit/fb3a83da8289d4f488cb2dafb1a33ee7079801a6]
Thank you for your contribution [[email protected]]
> Array functions return incorrect results for ROW elements
> ---------------------------------------------------------
>
> Key: CALCITE-7836
> URL: https://issues.apache.org/jira/browse/CALCITE-7836
> Project: Calcite
> Issue Type: Bug
> Reporter: Kirill Tkalenko
> Assignee: Kirill Tkalenko
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.43.0
>
>
> Array functions compare {{ROW}} elements by reference rather than by field
> values, causing incorrect results for independently constructed equal rows.
> Affected functions:
> * {{ARRAY_CONTAINS}}
> * {{ARRAY_POSITION}}
> * {{ARRAY_REMOVE}}
> * {{ARRAY_DISTINCT}}
> * {{ARRAY_UNION}}
> * {{ARRAY_INTERSECT}}
> * {{ARRAY_EXCEPT}}
> * {{ARRAYS_OVERLAP}}
> The issue also affects nested rows, such as {{ROW(ROW(...), ...)}} and
> {{{}ROW(ARRAY[ROW(...)], ...){}}}.
> Example:
> {code:java}
> SELECT ARRAY_CONTAINS(ARRAY[ROW(x, y)], ROW(z, w))
> FROM (VALUES
> (1, 'Foo', 1, 'Foo'),
> (2, 'Bar', 2, 'Bar')
> ) AS t(x, y, z, w);{code}
> Expected: {{true}} for both rows. Actual: {{false}} for both rows.
> Nested {{ROW}} values are also affected. Constant expressions may mask the
> issue.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)