Dian Fu created FLINK-11009:
-------------------------------

             Summary: Add support for FILTER clause for non-windowed 
aggregation in Table API and SQL
                 Key: FLINK-11009
                 URL: https://issues.apache.org/jira/browse/FLINK-11009
             Project: Flink
          Issue Type: Task
          Components: Table API & SQL
            Reporter: Dian Fu
            Assignee: Dian Fu


Currently the following clause is not supported in Flink, the *FILTER* clause 
is ignored in the AggregateCodeGenerator:
{code:java}
SELECT
  a, sum(b) filter (where c > 0)
FROM myTable
GROUP BY a;{code}
The aim of this ticket is to add support for *FILTER* clause for non-windowed 
aggregation in both Table API & SQL.

 

For Table API, it will look like this:
'a.count.filter('c > 0)
myUDAGG('a).filter('c > 0)
multiParamUDAGG('a, 'b).filter('c > 0)
 

When working with `distinct`, it will look like this: 
{code:java}
'a.count.distinct.filter('c > 0) or 'a.count.filter('c > 0).distinct

myUDAGG('a).distinct.filter('c > 0) or myUDAGG('a).filter('c > 0).distinct

multiParamUDAGG('a, 'b).distinct.filter('c > 0) or multiParamUDAGG('a, 
'b).filter('c > 0).distinct{code}
 



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

Reply via email to