zstan commented on a change in pull request #9070:
URL: https://github.com/apache/ignite/pull/9070#discussion_r642789988
##########
File path:
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/agg/Accumulators.java
##########
@@ -1003,4 +1016,53 @@ private DecimalMinMax(boolean min) {
return
typeFactory.createTypeWithNullability(typeFactory.createSqlType(DECIMAL), true);
}
}
+
+ /** */
+ private static class DistinctAccumulator implements Accumulator {
+ /** */
+ private final Accumulator acc;
+
+ /** */
+ private final Set<Object> set = new HashSet<>();
+
+ /** */
+ private DistinctAccumulator(Supplier<Accumulator> accSup) {
+ this.acc = accSup.get();
+ }
+
+ /** {@inheritDoc} */
+ @Override public void add(Object... args) {
+ Object in = args[0];
+
+ if (in == null)
+ return;
+
+ set.add(in);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void apply(Accumulator other) {
+ DistinctAccumulator other0 = (DistinctAccumulator) other;
Review comment:
space is redundant in cast.
--
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:
[email protected]