[ 
https://issues.apache.org/jira/browse/SPARK-8989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14682242#comment-14682242
 ] 

Reynold Xin commented on SPARK-8989:
------------------------------------

Thanks for looking at this, [~piccolbo].

> Support aggregations in HAVING clause
> -------------------------------------
>
>                 Key: SPARK-8989
>                 URL: https://issues.apache.org/jira/browse/SPARK-8989
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 1.4.0
>            Reporter: Antonio Piccolboni
>              Labels: aggregate, sql
>
> It seems like query of the type
> SELECT keys, id, value FROM table GROUP BY keys HAVING max(value) = value
> Are not working or supported (I selected issue type enhancement under the 
> assumption it's the latter). The use case is very natural, for each group 
> find the record attaining the maximum for a certain row-dependent expression, 
> and return any selection of fields from that row together with the grouping 
> keys. I know how to work around this with a join, but it's a considerably 
> more involved query and therefore I thought worth asking if this is my 
> misunderstanding, a shortcoming in the implementation of HAVING, a 
> nice-to-have but not really on the road map or "that's crazy what kind of 
> rotten database would accept this nonsense?" (by the way, I think PostgresSQL 
> does; not sure how many other DBs do)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to