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

Fabian Hueske commented on FLINK-4832:
--------------------------------------

Currently, a {{DataSetAggregate}} is translated into a {{MapFunction}} followed 
by a {{GroupReduceFunction}}.
The {{MapFunction}} initializes the aggregates and the {{GroupReduceFunction}} 
computes the aggregates.

I think we need to do the following. We need to inject a {{Union}} before the 
Map with static data set with a single record, that contains only null values 
for each field.
The {{CountAggregate}} initializes to {{0}} (which is what we want), all other 
functions initialize to {{null}} and ignore the record.


> Count/Sum 0 elements
> --------------------
>
>                 Key: FLINK-4832
>                 URL: https://issues.apache.org/jira/browse/FLINK-4832
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API & SQL
>            Reporter: Timo Walther
>
> Currently, the Table API is unable to count or sum up 0 elements. We should 
> improve DataSet aggregations for this. Maybe by union the original DataSet 
> with a dummy record or by using a MapPartition function. Coming up with a 
> good design for this is also part of this issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to