[ 
https://issues.apache.org/jira/browse/CALCITE-7678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18101130#comment-18101130
 ] 

Mihai Budiu commented on CALCITE-7678:
--------------------------------------

Another subtle point is that ARRAY[NULL] = ARRAY[NULL] is true. 

By symmetry, we must have ARRAY[ROW(NULL)] = ARRAY[ROW(NULL)] is true. 

But ROW(NULL) = ROW(NULL) is NULL.

In conclusion, ROW equality comparison will behave differently depending on 
whether ROWs are compared top-level or stored inside containers.

It's weird, but I think it's sound, and it matches a subset of Postgres.

> Runtime equality for ROW values produces incorrect results
> ----------------------------------------------------------
>
>                 Key: CALCITE-7678
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7678
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.42.0
>            Reporter: Mihai Budiu
>            Priority: Minor
>
> GROUP BY, DISTINCT, JOIN, UNION, etc by ROW-typed values produces incorrect 
> results, because ROWs are compiled to Object[] and are compared by reference 
> instead of being compared by value.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to