You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/04/10 09:54:09 UTC

[GitHub] [spark] cryeo opened a new pull request #24335: [SPARK-27425] Add count_if functions

cryeo opened a new pull request #24335: [SPARK-27425] Add count_if functions
URL: https://github.com/apache/spark/pull/24335
 
 
   ## What changes were proposed in this pull request?
   
   Add `count_if` function which is equivalent to `count_if` function of Presto.
   
   There is no aggregation function which returns the number of records satisfying a given condition in Spark, so we need to write like `COUNT(CASE WHEN some_condition THEN 1 END)` or `SUM(CASE WHEN some_condition THEN 1 END)}}, which looks painful.
   
   ## How was this patch tested?
   
   This patch is tested by unit test.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org