viirya commented on issue #24557: [SPARK-27653][SQL] Add max_by() SQL aggregate 
function
URL: https://github.com/apache/spark/pull/24557#issuecomment-490956031
 
 
   I've checked few test cases regarding null values in Presto:
   
   ```
   presto> select max_by(x, y) from ( values ('a', null), ('b', null), ('c', 
null) ) as t (x, y);
    _col0 
   -------
    NULL  
   (1 row)
   
   Query 20190509_050643_00001_ww5mk, FINISHED, 1 node
   Splits: 1 total, 1 done (100.00%)
   0:02 [0 rows, 0B] [0 rows/s, 0B/s]
   
   presto> select max_by(x, y) from ( values ('a', null), ('b', null), ('c', 
10) ) as t (x, y);
    _col0 
   -------
    c     
   (1 row)
   
   Query 20190509_050655_00002_ww5mk, FINISHED, 1 node
   Splits: 1 total, 1 done (100.00%)
   0:00 [0 rows, 0B] [0 rows/s, 0B/s]
   ```
   
   The results match the added test cases here.
   
   About prestodb/presto#2040, it is happened by null reference for the key 
field in Presto. This shouldn't be in our case.
   

----------------------------------------------------------------
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