You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is what I have added to the documentation. For all the existing operators, single examples sufficed since they followed a "one-way" comparison. While the spaceship operator is a three-way comparation. If this seems excessive, please let me know!
(op_spaceship)=
<=>
Three-way comparision operator. A NULL-safe operator that returns true if both operands are equal or both are NULL, false otherwise.
>SELECTNULL<=>NULL;
+--------------------------------+
| NULL IS NOT DISTINCT FROMNULL |
+--------------------------------+
| true |
+--------------------------------+
>SELECT1<=>NULL;
+------------------------------------+
| Int64(1) IS NOT DISTINCT FROMNULL |
+------------------------------------+
| false |
+------------------------------------+
>SELECT1<=>2;
+----------------------------------------+
| Int64(1) IS NOT DISTINCT FROM Int64(2) |
+----------------------------------------+
| false |
+----------------------------------------+
>SELECT1<=>1;
+----------------------------------------+
| Int64(1) IS NOT DISTINCT FROM Int64(1) |
+----------------------------------------+
| true |
+----------------------------------------+
I would also like to suggest that for the sake of clarity, we ensure that the description of the Spaceship operator is the similar to that of IS DISTINCT FROM. The documentation for IS DISTINCT FROM`` says this in the description: Guarantees the result of a comparison is true or false and not an empty set```
So the description for the Spaceship Operator becomes: Three-way comparison operator. Guarantees the result of a comparison is `true` or `false` and not an empty set.
But I feel this explanation to be lacking. Hence my suggestion is to change the description of IS DISTINCT FROM`` to the one I have chosen for the Spaceship operator. Hence, the description for IS DISTINCT FROMwould become:A NULL-safe operator that returns false if both operands are equal or both are NULL, true otherwise.```
Activity
Spaarsh commentedon Jan 19, 2025
take
alamb commentedon Jan 20, 2025
Thanks @comphead and @Spaarsh !
Spaarsh commentedon Jan 20, 2025
This is what I have added to the documentation. For all the existing operators, single examples sufficed since they followed a "one-way" comparison. While the spaceship operator is a three-way comparation. If this seems excessive, please let me know!
(op_spaceship)=
<=>Three-way comparision operator. A NULL-safe operator that returns true if both operands are equal or both are NULL, false otherwise.
I would also like to suggest that for the sake of clarity, we ensure that the description of the Spaceship operator is the similar to that of
IS DISTINCT FROM. The documentation forIS DISTINCT FROM`` says this in the description:Guarantees the result of a comparison istrueorfalseand not an empty set```So the description for the Spaceship Operator becomes:
Three-way comparison operator. Guarantees the result of a comparison is `true` or `false` and not an empty set.But I feel this explanation to be lacking. Hence my suggestion is to change the description of
IS DISTINCT FROM`` to the one I have chosen for the Spaceship operator. Hence, the description forIS DISTINCT FROMwould become:A NULL-safe operator that returns false if both operands are equal or both are NULL, true otherwise.```