You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Ian Cook (Jira)" <ji...@apache.org> on 2022/06/30 15:17:00 UTC

[jira] [Updated] (ARROW-16718) [C++] Implement is_distinct_from and is_not_distinct_from kernels

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

Ian Cook updated ARROW-16718:
-----------------------------
    Description: 
Some SQL engines have the comparison operators {{IS DISTINCT FROM}} and {{IS NOT DISTINCT FROM}}. These are so-called {_}null-safe comparison operators{_}.

As explained in the Impala docs:
{quote}The IS DISTINCT FROM operator, and its converse the IS NOT DISTINCT FROM operator, test whether or not values are identical. IS NOT DISTINCT FROM is similar to the = operator, and IS DISTINCT FROM is similar to the != operator, except that NULL values are treated as identical. Therefore, IS NOT DISTINCT FROM returns true rather than NULL, and IS DISTINCT FROM returns false rather than NULL, when comparing two NULL values. If one of the values being compared is NULL and the other is not, IS DISTINCT FROM returns true and IS NOT DISTINCT FROM returns false, again instead of returning NULL in both cases.
{quote}
It would be a nice convenience to have these implemented as kernels in Arrow.

N.B. some SQL engines use the comparison operator {{<=>}} as shorthand for {{IS NOT DISTINCT FROM}}.

  was:
Some SQL engines have the comparison operators {{IS DISTINCT FROM}} and {{{}IS NOT DISTINCT FROM{}}}. These are so-called {_}null-safe comparison operators{_}.

As explained in the Impala docs:
{quote}The IS DISTINCT FROM operator, and its converse the IS NOT DISTINCT FROM operator, test whether or not values are identical. IS NOT DISTINCT FROM is similar to the = operator, and IS DISTINCT FROM is similar to the != operator, except that NULL values are treated as identical. Therefore, IS NOT DISTINCT FROM returns true rather than NULL, and IS DISTINCT FROM returns false rather than NULL, when comparing two NULL values. If one of the values being compared is NULL and the other is not, IS DISTINCT FROM returns true and IS NOT DISTINCT FROM returns false, again instead of returning NULL in both cases.
{quote}
It would be a nice convenience to have these implemented as kernels in Arrow.


> [C++] Implement is_distinct_from and is_not_distinct_from kernels
> -----------------------------------------------------------------
>
>                 Key: ARROW-16718
>                 URL: https://issues.apache.org/jira/browse/ARROW-16718
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: C++
>            Reporter: Ian Cook
>            Priority: Minor
>
> Some SQL engines have the comparison operators {{IS DISTINCT FROM}} and {{IS NOT DISTINCT FROM}}. These are so-called {_}null-safe comparison operators{_}.
> As explained in the Impala docs:
> {quote}The IS DISTINCT FROM operator, and its converse the IS NOT DISTINCT FROM operator, test whether or not values are identical. IS NOT DISTINCT FROM is similar to the = operator, and IS DISTINCT FROM is similar to the != operator, except that NULL values are treated as identical. Therefore, IS NOT DISTINCT FROM returns true rather than NULL, and IS DISTINCT FROM returns false rather than NULL, when comparing two NULL values. If one of the values being compared is NULL and the other is not, IS DISTINCT FROM returns true and IS NOT DISTINCT FROM returns false, again instead of returning NULL in both cases.
> {quote}
> It would be a nice convenience to have these implemented as kernels in Arrow.
> N.B. some SQL engines use the comparison operator {{<=>}} as shorthand for {{IS NOT DISTINCT FROM}}.



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