You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by GitBox <gi...@apache.org> on 2022/11/23 05:20:23 UTC

[GitHub] [age] MuhammadTahaNaveed opened a new issue, #364: Equality of NULL in a list.

MuhammadTahaNaveed opened a new issue, #364:
URL: https://github.com/apache/age/issues/364

   Hello everyone. I have a small query regarding **equality of null data type in a list**.
   
   - In the documentation, it is written that `SELECT * FROM cypher('graph',$$RETURN null = null$$) AS (p agtype);` produces `null` and the concept behind that is explained in documentation.
   
   ![image](https://user-images.githubusercontent.com/85064039/203472995-5af6cded-6779-49c2-8653-c87553e418c7.png)
   
   
   - So , according to this concept, I thought `SELECT * FROM cypher('graph',$$RETURN [null] = [null]$$) AS (p agtype);` will also generate `null` as output, but it generated true.
   
   ![image](https://user-images.githubusercontent.com/85064039/203472972-efc16f99-26c7-4b94-bcae-b5feb643ce84.png)
   
   Is there any specific reason for that ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] MuhammadTahaNaveed commented on issue #364: Equality of NULL in a list.

Posted by GitBox <gi...@apache.org>.
MuhammadTahaNaveed commented on issue #364:
URL: https://github.com/apache/age/issues/364#issuecomment-1325852723

   Ok, now I understand. Thanks for the detailed answer. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] MuhammadTahaNaveed closed issue #364: Equality of NULL in a list.

Posted by GitBox <gi...@apache.org>.
MuhammadTahaNaveed closed issue #364: Equality of NULL in a list.
URL: https://github.com/apache/age/issues/364


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] jrgemignani commented on issue #364: Equality of NULL in a list.

Posted by GitBox <gi...@apache.org>.
jrgemignani commented on issue #364:
URL: https://github.com/apache/age/issues/364#issuecomment-1325632051

   This is due to a design decision in the very beginning of AGE - 
   
   There is comparability, which is how something compares, equates, to something else. Then there is orderability, which is how something is ordered, or sorted, relative to something else. They are very similar, but not the same. Unfortunately, you can only have one of these used for operations in AGE. 
   
   Sort of,...
   
   It was decided that in order to allow NULLs to group together **in sorted output** we would allow NULL = NULL. This is why NULLs group together in ordered outputs **and** why that second command returned **true**.
   
   Now for the sort of part,...
   
   Depending on whether the NULL is by itself, or in some container, it will follow different rules. This is because the function that does the actual comparison, is set to '**RETURNS NULL ON NULL INPUT**'. If it is a simple NULL, then the function never gets called and a NULL is returned. Otherwise, it will call the function and apply the orderability rule instead.
   
   In your first query, it used '**RETURNS NULL ON NULL INPUT**'. In your second query, the NULL is in a container, so it called the function because neither inputs were NULL and applied the orderability rule.
   
   Hopefully, this explains it a bit.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org