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 20:37:35 UTC

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

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