ygerzhedovich commented on code in PR #4522:
URL: https://github.com/apache/ignite-3/pull/4522#discussion_r1796558284


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/agg/Accumulators.java:
##########
@@ -400,25 +447,34 @@ public RelDataType returnType(IgniteTypeFactory 
typeFactory) {
         }
     }
 
-    private static class LongCount implements Accumulator {
+    /** {@code COUNT(LONG)} accumulator.. */
+    public static class LongCount implements Accumulator {
         public static final Supplier<Accumulator> FACTORY = LongCount::new;
 
-        private long cnt;
-
         /** {@inheritDoc} */
         @Override
-        public void add(Object... args) {
+        public void add(AccumulatorsState state, Object... args) {
             assert nullOrEmpty(args) || args.length == 1;
 
             if (nullOrEmpty(args) || args[0] != null) {
-                cnt++;
+                Long cnt = (Long) state.get();

Review Comment:
   I just want to avoid unnecessary boxing/unboxing in a few lines below during 
the increment of the counter value



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

To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org

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

Reply via email to