maropu edited a comment on issue #27233: [SPARK-29701][SQL] Correct behaviours 
of group analytical queries when empty input given
URL: https://github.com/apache/spark/pull/27233#issuecomment-577457202
 
 
   >  it seems weird to be to return count of 0 when you have no grouping
   
   @tgravescs we need more checks and could you show us these results (MS SQL 
server and Oracle) here? IIUC this is a known behaviour in the relational 
database theory;
   ```
   Another property that is hard to understand at first is how GROUP BY works 
on an empty
   set. Consider this query:
   
   SELECT SUM(x) FROM Empty;
   
   which returns a result table with a single NULL. 
   ```
   cited from `Joe Celko's Data and Databases: Concepts in Practice`, p79-80, 
http://www.library.uc.edu.kh/userfiles/pdf/35.Joe%20Celko's%20Data%20and%20Databases%20Concepts%20in%20Practice.pdf

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to