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

Rong Rong commented on FLINK-5315:
----------------------------------

You are right, in the actual translation {{distinct}} is translated to a all 
field {{GROUP GY}} in the {{select}} statement. so yes. I might have chosen the 
wright word syntactically they are kind of similar: like I mentioned before. 
{{select('a, 'b).distinct}} should considered to be {{select.distinct('a, 'b)}} 
syntactically since it is aligned with the SQL expression {{SELECT DISTINCT a, 
b FROM table}}.
But I see your point, making the {{distinct}} directly stick with the 
aggregation expression/function makes it clear what it is modified with. 

Do you think we should aligned the syntax? e.g. (1) making {{select.distinct('a 
,'b)}} or (2) having {{udagg('a, 'b).distinct}}. 
 
The reason why I brought this up is I am in the SQL domain most of the time, 
and {{SELECT DISTINCT a, b FROM table}} and {{SELECT COUNT(DISTINCT a), 
SUM(DISTINCT b) FROM table}} are aligned and make perfect sense to me.

> 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
>
> Support distinct aggregations in Table API in the following format:
> For Expressions:
> {code:scala}
> 'a.count.distinct // Expressions distinct modifier
> {code}
> For User-defined Function:
> {code:scala}
> singleArgUdaggFunc.distinct('a) // FunctionCall distinct modifier
> multiArgUdaggFunc.distinct('a, 'b) // FunctionCall distinct modifier
> {code}



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

Reply via email to