[ https://issues.apache.org/jira/browse/SPARK-20747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16015776#comment-16015776 ]
Takeshi Yamamuro commented on SPARK-20747: ------------------------------------------ You mean this query below? {code} scala> Seq((1, 1), (1, 1), (1, 1)).toDF("a", "b").createOrReplaceTempView("t") scala> sql("""select a, avg(distinct b) from t group by a""").show +---+---------------+ | a|avg(DISTINCT b)| +---+---------------+ | 1| 1.0| +---+---------------+ {code} It seems these syntaxes already supported though, am I missing something? > Distinct in Aggregate Functions > ------------------------------- > > Key: SPARK-20747 > URL: https://issues.apache.org/jira/browse/SPARK-20747 > Project: Spark > Issue Type: Sub-task > Components: SQL > Affects Versions: 2.2.0 > Reporter: Xiao Li > > {noformat} > AVG ([DISTINCT]|[ALL] <numeric expression>) > MAX ([DISTINCT]|[ALL] <expression>) > MIN ([DISTINCT]|[ALL] <expression>) > SUM ([DISTINCT]|[ALL] <numeric_expression>) > {noformat} > Except COUNT, the DISTINCT clause is not supported by Spark SQL -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org