You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Reynold Xin (JIRA)" <ji...@apache.org> on 2015/07/20 02:58:04 UTC

[jira] [Commented] (SPARK-8989) Support aggregations in HAVING clause

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

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

[~piccolbo] can you survey a bit to see what common database systems support this?


> 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org