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

Hequn Cheng commented on FLINK-5315:
------------------------------------

Hi [~fhueske] hmm, I think these are two kinds of distinct. One is distinct of 
agg, the other is distinct of table. So, we can define that:
 The query
{code:java}
table.groupBy('a).select('b.count.distinct) 
{code}
as
{code:java}
SELECT COUNT(DISTINCT b) FROM table GROUP BY a
{code}
while
{code:java}
table.groupBy('a).select('b.count as 'cnt).distinct
{code}
as
{code:java}
SELECT DISTINCT cnt FROM (SELECT COUNT(b) AS cnt FROM table GROUP BY a)
{code}


> Support distinct aggregations in table api
> ------------------------------------------
>
>                 Key: FLINK-5315
>                 URL: https://issues.apache.org/jira/browse/FLINK-5315
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API & SQL
>            Reporter: Kurt Young
>            Assignee: Rong Rong
>            Priority: Major
>
> Such as 
> {code}
> t.select("count(distinct a), sum(b)")
> {code}
> or 
> {code}
> t.select('a.count.distinct), 'b.sum)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to