smiklosovic commented on code in PR #3872:
URL: https://github.com/apache/cassandra/pull/3872#discussion_r1944207551


##########
src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:
##########
@@ -836,6 +836,66 @@ public void addInput(Arguments arguments)
         }
     };
 
+    private static abstract class AbstractNativeAggregate implements 
AggregateFunction.Aggregate
+    {
+        private final AbstractType<?> returnType;
+
+        public AbstractNativeAggregate(AbstractType<?> returnType)
+        {
+            this.returnType = returnType;
+        }
+
+        private ByteBuffer result;
+
+        @Override
+        public void reset()
+        {
+            result = null;
+        }
+
+        @Override
+        public ByteBuffer compute(ProtocolVersion protocolVersion)
+        {
+            return result;
+        }
+
+        @Override
+        public void addInput(Arguments arguments)
+        {
+            ByteBuffer value = arguments.get(0);
+
+            if (value == null)
+                return;
+
+            if (returnType.isReversed())

Review Comment:
   ah really :D I was completely oblivious to that. Thanks, that's super simple 
fix 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to