AMashenkov commented on code in PR #6479: URL: https://github.com/apache/ignite-3/pull/6479#discussion_r2313999755
########## modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/agg/Accumulators.java: ########## @@ -217,6 +221,62 @@ private Supplier<Accumulator> anyValueFactory(AggregateCall call) { return AnyVal.newAccumulator(type); } + private Supplier<Accumulator> groupingFactory(AggregateCall call) { + RelDataType type = call.getType(); + + if (type.getSqlTypeName() == ANY && !(type instanceof IgniteCustomType)) { + throw unsupportedAggregateFunction(call); + } + + return () -> new GroupingAccumulator(call.getArgList()); + } + + /** + * {@code GROUPING(column [, ...])} accumulator. Pseudo accumulator that accepts group key columns set. + */ + public static class GroupingAccumulator implements Accumulator { + private final List<Integer> argList; + + public GroupingAccumulator(List<Integer> argList) { + assert argList.size() < Long.SIZE : "GROUPING function with more than 63 arguments is not supported."; Review Comment: Tests added -- 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