Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/3470#discussion_r104298360
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/functions/aggfunctions/SumAggFunction.scala
---
@@ -67,9 +80,9 @@ abstract class SumAggFunction[T: Numeric] extends
AggregateFunction[T] {
var i: Int = 0
while (i < accumulators.size()) {
val a = accumulators.get(i).asInstanceOf[SumAccumulator[T]]
- if (a.f1) {
+ if (a.f1 > 0) {
--- End diff --
Do we need this check? If `a.f1` is `0`, `a.f0` should be `0` as well (if
we only retract what was added before) and we can simply add sum and count.
---
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.
---