You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/12/24 05:29:03 UTC

[GitHub] [calcite] danny0405 commented on a change in pull request #1676: [CALCITE-3591] Add bit_xor aggregate function

danny0405 commented on a change in pull request #1676: [CALCITE-3591] Add bit_xor aggregate function
URL: https://github.com/apache/calcite/pull/1676#discussion_r361069020
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java
 ##########
 @@ -1552,9 +1554,15 @@ public Expression implementResult(AggContext info,
       Expression acc = add.accumulator().get(0);
       Expression arg = add.arguments().get(0);
       SqlAggFunction aggregation = info.aggregation();
-      final Method method = (aggregation == BIT_AND
-          ? BuiltInMethod.BIT_AND
-          : BuiltInMethod.BIT_OR).method;
+
+      BuiltInMethod builtInMethod = BuiltInMethod.BIT_AND;
+      if (aggregation == BIT_OR) {
+        builtInMethod = BuiltInMethod.BIT_OR;
+      } else if (aggregation == BIT_XOR) {
+        builtInMethod = BuiltInMethod.BIT_XOR;
+      }
 
 Review comment:
   Use switch case seems more clear.

----------------------------------------------------------------
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


With regards,
Apache Git Services