hagerf opened a new pull request #26762: [SPARK-30131] add array_median 
function 
URL: https://github.com/apache/spark/pull/26762
 
 
   ### What changes were proposed in this pull request?
   In this PR I have added a dataframe function `array_median` that takes in 
one argument i.e. the array, checks that it only contains numeric values and 
returns the median value as a double.
   
   
   ### Why are the changes needed?
   It is known that there isn't any exact median function in Spark SQL, and 
this might be a difficult problem to solve efficiently. However, to find the 
median for an array should be a simple task, and something that users can 
utilize when collecting numeric values to a list or set.
   
   ### Does this PR introduce any user-facing change?
   Yes, a new function will be available for users, `array_median`.
   
   
   ### How was this patch tested?
   unit tests
   

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