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 2020/10/21 08:22:28 UTC

[GitHub] [spark] zero323 edited a comment on pull request #30107: [WIP][SPARK-33196][SQL] Expose filtered aggregations in spark.sql.functions

zero323 edited a comment on pull request #30107:
URL: https://github.com/apache/spark/pull/30107#issuecomment-713155178


   I have mixed feelings about this. At the moment we can easily use `when` to handle this use case
   
   ```scala
   count(when(df("id") < 50, 1))
   ```
   
   It doesn't require extensions of the DSL, and it is in practice as concise and (arguably) as readable as the proposed addition.
   
   **Edit**
   
   It is also straightforward to use FILTER within expr
   
   ```scala
   expr("count(1) FILTER (WHERE id < 50)")
   ```


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



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