You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/06/02 15:59:21 UTC

[GitHub] [ignite] ivandasch commented on a diff in pull request #10059: IGNITE-15550 SQL Calcite: implement ARRAY, ARRAY_AGG, ARRAY_CONCAT_AGG and MAP support

ivandasch commented on code in PR #10059:
URL: https://github.com/apache/ignite/pull/10059#discussion_r888123560


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/agg/Accumulators.java:
##########
@@ -1158,6 +1191,71 @@ private String extractSeparator(Row row) {
         }
     }
 
+    /** */
+    private static class ArrayAggregateAccumulator<Row> extends AggAccumulator<Row> {
+        /** */
+        public ArrayAggregateAccumulator(AggregateCall aggCall, RowHandler<Row> hnd) {
+            super(aggCall, hnd);
+        }
+
+        /** {@inheritDoc} */
+        @Override public Object end() {
+            List<Object> result = new ArrayList<>(size());
+
+            for (Row row: this)
+                result.add(get(0, row));

Review Comment:
   Buffer contains Rows (list of arrays)



-- 
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-unsubscribe@ignite.apache.org

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