You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/06/28 18:16:18 UTC

[GitHub] [beam] amaliujia commented on a change in pull request #12110: [BEAM-9890] Try fixing BIT_AND(NULL) issue

amaliujia commented on a change in pull request #12110:
URL: https://github.com/apache/beam/pull/12110#discussion_r446681312



##########
File path: sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/transform/BeamBuiltinAggregations.java
##########
@@ -393,29 +393,52 @@ public Long extractOutput(Long accum) {
     }
   }
 
-  static class BitAnd<T extends Number> extends CombineFn<T, Long, Long> {
+  static class BitAnd<T extends Number> extends CombineFn<T, BitAnd.Accum, Long> {
+    public static class Accum {
+      long val = -1L;
+      boolean isEmpty = true;
+      boolean seenNull = false;
+    }
+
     @Override
-    public Long createAccumulator() {
-      return -1L;

Review comment:
       why not still use Long, why change to Accum class?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org