[ 
https://issues.apache.org/jira/browse/CALCITE-7836?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated CALCITE-7836:
------------------------------------
    Labels: pull-request-available  (was: )

> 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
>
> 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)

Reply via email to