omarismail94 commented on a change in pull request #11737:
URL: https://github.com/apache/beam/pull/11737#discussion_r426935461



##########
File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/transform/BeamBuiltinAggregations.java
##########
@@ -347,4 +357,35 @@ public BigDecimal toBigDecimal(BigDecimal record) {
       return record;
     }
   }
+
+  static class BitOr<T extends Number> extends CombineFn<T, BitOr.Accum, Long> 
{
+    static class Accum {

Review comment:
       Actually, this might work, let me test this
   ```
     static class BitOr<T extends Number> extends CombineFn<T, Long, Long> {
       @Override
       public Long createAccumulator() {
         return 0L;
       }
   
       @Override
       public Long addInput(Long accum, T input) {
         return accum | input.longValue();
       }
   
       @Override
       public Long mergeAccumulators(Iterable<Long> accums) {
         Long merged = createAccumulator();
         for (Long accum : accums) {
           merged = merged | accum;
         }
         return merged;
       }
   
       @Override
       public Long extractOutput(Long accum) {
         return accum;
       }
     }
   }
   ```

##########
File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/transform/BeamBuiltinAggregations.java
##########
@@ -347,4 +357,35 @@ public BigDecimal toBigDecimal(BigDecimal record) {
       return record;
     }
   }
+
+  static class BitOr<T extends Number> extends CombineFn<T, BitOr.Accum, Long> 
{
+    static class Accum {

Review comment:
       It worked! Will commit this now!




----------------------------------------------------------------
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:
[email protected]


Reply via email to