flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhue...@apache.org
Subject [1/5] flink git commit: [FLINK-7971] [table] Fix potential NPE in non-windowed aggregation.
Date Wed, 08 Nov 2017 17:50:52 GMT
Repository: flink
Updated Branches:
  refs/heads/release-1.4 f5a0b4bdf -> c79432915


[FLINK-7971] [table] Fix potential NPE in non-windowed aggregation.

This closes #4941.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/a126bd3e
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/a126bd3e
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/a126bd3e

Branch: refs/heads/release-1.4
Commit: a126bd3e7d9614749f61692fbb53c5b284f17091
Parents: f5a0b4b
Author: Xpray <leonxpray@gmail.com>
Authored: Fri Nov 3 15:19:42 2017 +0800
Committer: Fabian Hueske <fhueske@apache.org>
Committed: Wed Nov 8 18:43:31 2017 +0100

----------------------------------------------------------------------
 .../flink/table/runtime/aggregate/GroupAggProcessFunction.scala | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/a126bd3e/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/GroupAggProcessFunction.scala
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/GroupAggProcessFunction.scala
b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/GroupAggProcessFunction.scala
index 91c379f..3970320 100644
--- a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/GroupAggProcessFunction.scala
+++ b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/GroupAggProcessFunction.scala
@@ -97,11 +97,14 @@ class GroupAggProcessFunction(
     if (null == accumulators) {
       firstRow = true
       accumulators = function.createAccumulators()
-      inputCnt = 0L
     } else {
       firstRow = false
     }
 
+    if (null == inputCnt) {
+      inputCnt = 0L
+    }
+
     // Set group keys value to the final output
     function.setForwardedFields(input, newRow.row)
     function.setForwardedFields(input, prevRow.row)


Mime
View raw message