Github user aljoscha commented on the pull request:

    https://github.com/apache/flink/pull/834#issuecomment-112127936
  
    OK, I had some offline discussion with @mxm and @fhueske. We thought that 
we should have this behaviour: 
https://en.wikipedia.org/wiki/Null_(SQL)#Aggregate_functions.
    
    The COUNT(a) should be correct with this PR since it is implemented as 
SUM(1), so this counts also those elements where a = null. The only problem is 
AVG(), which right now would provide incorrect results since AVG(a) is 
generated as SUM(a)/SUM(1). The SUM(1) here needs to be changed to something 
that only counts when a != null.
    
    Then of course we would need tests for the correct behaviour of these 
aggregations in the presence of null values.
    
    What do you think?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to