flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rong Rong (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-5315) Support distinct aggregations in table api
Date Fri, 03 Aug 2018 14:26:00 GMT

    [ 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 &amp; 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)

Mime
View raw message