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

ASF GitHub Bot commented on FLINK-5315:
---------------------------------------

fhueske commented on a change in pull request #6521: [FLINK-5315][table] Adding 
support for distinct operation for table API on DataStream
URL: https://github.com/apache/flink/pull/6521#discussion_r211213843
 
 

 ##########
 File path: docs/dev/table/udfs.md
 ##########
 @@ -650,6 +650,36 @@ tEnv.sqlQuery("SELECT user, wAvg(points, level) AS 
avgPoints FROM userScores GRO
 </div>
 </div>
 
+User-defined aggregation function can be used with `distinct` modifiers. To 
calculate the aggregate results only for distinct values, simply add the 
distinct modifier towards the aggregation function.
 
 Review comment:
   I would not add the documentation of this syntax here (this page applies to 
Table API and SQL) but rather to the Table API docs (the sections that you 
added). For example the Java API also supports (`sum.distinct(a)` instead of 
`a.sum.distinct` for built-in functions).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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 &amp; SQL
>            Reporter: Kurt Young
>            Assignee: Rong Rong
>            Priority: Major
>              Labels: pull-request-available
>
> 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