From b6da0bb3d43e6e0750323a840e32754141141dbb Mon Sep 17 00:00:00 2001 From: Wenchao Wu <60921147+Stephen0421@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:21:43 +0800 Subject: [PATCH] [core] enable self-define FieldAggregator. (#4335) --- .../compact/aggregate/FieldAggregator.java | 142 +++--------------- .../compact/aggregate/FieldBoolAndAgg.java | 2 +- .../compact/aggregate/FieldBoolOrAgg.java | 2 +- .../compact/aggregate/FieldCollectAgg.java | 2 +- .../aggregate/FieldFirstNonNullValueAgg.java | 2 +- .../aggregate/FieldIgnoreRetractAgg.java | 2 +- .../aggregate/FieldLastNonNullValueAgg.java | 2 +- .../compact/aggregate/FieldLastValueAgg.java | 2 +- .../compact/aggregate/FieldListaggAgg.java | 2 +- .../compact/aggregate/FieldMaxAgg.java | 2 +- .../compact/aggregate/FieldMergeMapAgg.java | 2 +- .../compact/aggregate/FieldMinAgg.java | 2 +- .../aggregate/FieldNestedUpdateAgg.java | 2 +- .../compact/aggregate/FieldPrimaryKeyAgg.java | 2 +- .../compact/aggregate/FieldProductAgg.java | 2 +- .../compact/aggregate/FieldSumAgg.java | 2 +- .../factory/FieldAggregatorFactory.java | 32 ++++ .../factory/FieldBoolAndAggFactory.java | 37 +++++ .../factory/FieldBoolOrAggFactory.java | 37 +++++ .../factory/FieldCollectAggFactory.java | 44 ++++++ .../FieldFirstNonNullValueAggFactory.java | 37 +++++ ...ieldFirstNonNullValueAggLegacyFactory.java | 37 +++++ .../factory/FieldFirstValueAggFactory.java | 37 +++++ .../factory/FieldHllSketchAggFactory.java | 44 ++++++ .../FieldLastNonNullValueAggFactory.java | 37 +++++ .../factory/FieldLastValueAggFactory.java | 37 +++++ .../factory/FieldListaggAggFactory.java | 37 +++++ .../aggregate/factory/FieldMaxAggFactory.java | 37 +++++ .../factory/FieldMergeMapAggFactory.java | 44 ++++++ .../aggregate/factory/FieldMinAggFactory.java | 37 +++++ .../factory/FieldNestedUpdateAggFactory.java | 58 +++++++ .../factory/FieldPrimaryKeyAggFactory.java | 37 +++++ .../factory/FieldProductAggFactory.java | 37 +++++ .../FieldRoaringBitmap32AggFactory.java | 44 ++++++ .../FieldRoaringBitmap64AggFactory.java | 44 ++++++ .../aggregate/factory/FieldSumAggFactory.java | 37 +++++ .../factory/FieldThetaSketchAggFactory.java | 44 ++++++ .../org.apache.paimon.factories.Factory | 20 +++ .../aggregate/FieldAggregatorTest.java | 15 ++ .../compact/aggregate/TestCostomAgg.java | 38 +++++ .../aggregate/TestCostomAggFactory.java | 36 +++++ .../org.apache.paimon.factories.Factory | 36 +++++ 42 files changed, 1015 insertions(+), 137 deletions(-) create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldAggregatorFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldBoolAndAggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldBoolOrAggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldCollectAggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldFirstNonNullValueAggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldFirstNonNullValueAggLegacyFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldFirstValueAggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldHllSketchAggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldLastNonNullValueAggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldLastValueAggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldListaggAggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldMaxAggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldMergeMapAggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldMinAggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldNestedUpdateAggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldPrimaryKeyAggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldProductAggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldRoaringBitmap32AggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldRoaringBitmap64AggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldSumAggFactory.java create mode 100644 paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldThetaSketchAggFactory.java create mode 100644 paimon-core/src/test/java/org/apache/paimon/mergetree/compact/aggregate/TestCostomAgg.java create mode 100644 paimon-core/src/test/java/org/apache/paimon/mergetree/compact/aggregate/TestCostomAggFactory.java create mode 100644 paimon-core/src/test/resources/META-INF/services/org.apache.paimon.factories.Factory diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldAggregator.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldAggregator.java index 2737c691dbdb..b776f0a2ec93 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldAggregator.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldAggregator.java @@ -19,19 +19,13 @@ package org.apache.paimon.mergetree.compact.aggregate; import org.apache.paimon.CoreOptions; -import org.apache.paimon.types.ArrayType; +import org.apache.paimon.factories.FactoryUtil; +import org.apache.paimon.mergetree.compact.aggregate.factory.FieldAggregatorFactory; import org.apache.paimon.types.DataType; -import org.apache.paimon.types.MapType; -import org.apache.paimon.types.RowType; -import org.apache.paimon.types.VarBinaryType; import javax.annotation.Nullable; import java.io.Serializable; -import java.util.Collections; -import java.util.List; - -import static org.apache.paimon.utils.Preconditions.checkArgument; /** abstract class of aggregating a field of a row. */ public abstract class FieldAggregator implements Serializable { @@ -52,129 +46,33 @@ public static FieldAggregator createFieldAggregator( String field) { FieldAggregator fieldAggregator; if (isPrimaryKey) { - fieldAggregator = new FieldPrimaryKeyAgg(fieldType); - } else { - // If the field has no aggregate function, use last_non_null_value. - if (strAgg == null) { - fieldAggregator = new FieldLastNonNullValueAgg(fieldType); - } else { - // ordered by type root definition - switch (strAgg) { - case FieldSumAgg.NAME: - fieldAggregator = new FieldSumAgg(fieldType); - break; - case FieldMaxAgg.NAME: - fieldAggregator = new FieldMaxAgg(fieldType); - break; - case FieldMinAgg.NAME: - fieldAggregator = new FieldMinAgg(fieldType); - break; - case FieldLastNonNullValueAgg.NAME: - fieldAggregator = new FieldLastNonNullValueAgg(fieldType); - break; - case FieldLastValueAgg.NAME: - fieldAggregator = new FieldLastValueAgg(fieldType); - break; - case FieldListaggAgg.NAME: - fieldAggregator = new FieldListaggAgg(fieldType, options, field); - break; - case FieldBoolOrAgg.NAME: - fieldAggregator = new FieldBoolOrAgg(fieldType); - break; - case FieldBoolAndAgg.NAME: - fieldAggregator = new FieldBoolAndAgg(fieldType); - break; - case FieldFirstValueAgg.NAME: - fieldAggregator = new FieldFirstValueAgg(fieldType); - break; - case FieldFirstNonNullValueAgg.NAME: - case FieldFirstNonNullValueAgg.LEGACY_NAME: - fieldAggregator = new FieldFirstNonNullValueAgg(fieldType); - break; - case FieldProductAgg.NAME: - fieldAggregator = new FieldProductAgg(fieldType); - break; - case FieldNestedUpdateAgg.NAME: - fieldAggregator = - createFieldNestedUpdateAgg( - fieldType, options.fieldNestedUpdateAggNestedKey(field)); - break; - case FieldCollectAgg.NAME: - checkArgument( - fieldType instanceof ArrayType, - "Data type for collect column must be 'Array' but was '%s'.", - fieldType); - fieldAggregator = - new FieldCollectAgg( - (ArrayType) fieldType, - options.fieldCollectAggDistinct(field)); - break; - case FieldMergeMapAgg.NAME: - checkArgument( - fieldType instanceof MapType, - "Data type of merge map column must be 'MAP' but was '%s'", - fieldType); - fieldAggregator = new FieldMergeMapAgg((MapType) fieldType); - break; - case FieldThetaSketchAgg.NAME: - checkArgument( - fieldType instanceof VarBinaryType, - "Data type for theta sketch column must be 'VarBinaryType' but was '%s'.", - fieldType); - fieldAggregator = new FieldThetaSketchAgg((VarBinaryType) fieldType); - break; - case FieldHllSketchAgg.NAME: - checkArgument( - fieldType instanceof VarBinaryType, - "Data type for hll sketch column must be 'VarBinaryType' but was '%s'.", - fieldType); - fieldAggregator = new FieldHllSketchAgg((VarBinaryType) fieldType); - break; - case FieldRoaringBitmap32Agg.NAME: - checkArgument( - fieldType instanceof VarBinaryType, - "Data type for roaring bitmap column must be 'VarBinaryType' but was '%s'.", - fieldType); - fieldAggregator = new FieldRoaringBitmap32Agg((VarBinaryType) fieldType); - break; - case FieldRoaringBitmap64Agg.NAME: - checkArgument( - fieldType instanceof VarBinaryType, - "Data type for roaring bitmap column must be 'VarBinaryType' but was '%s'.", - fieldType); - fieldAggregator = new FieldRoaringBitmap64Agg((VarBinaryType) fieldType); - break; - default: - throw new RuntimeException( - String.format( - "Use unsupported aggregation: %s or spell aggregate function incorrectly!", - strAgg)); - } - } + strAgg = FieldPrimaryKeyAgg.NAME; + } else if (strAgg == null) { + strAgg = FieldLastNonNullValueAgg.NAME; } - if (ignoreRetract) { - fieldAggregator = new FieldIgnoreRetractAgg(fieldAggregator); + FieldAggregatorFactory fieldAggregatorFactory = + FactoryUtil.discoverFactory( + FieldAggregator.class.getClassLoader(), + FieldAggregatorFactory.class, + strAgg); + if (fieldAggregatorFactory == null) { + throw new RuntimeException( + String.format( + "Use unsupported aggregation: %s or spell aggregate function incorrectly!", + strAgg)); } - return fieldAggregator; - } + fieldAggregator = fieldAggregatorFactory.create(fieldType, options, field); - private static FieldAggregator createFieldNestedUpdateAgg( - DataType fieldType, List nestedKey) { - if (nestedKey == null) { - nestedKey = Collections.emptyList(); + if (ignoreRetract) { + fieldAggregator = new FieldIgnoreRetractAgg(fieldAggregator); } - String typeErrorMsg = "Data type of nested table column must be 'Array' but was '%s'."; - checkArgument(fieldType instanceof ArrayType, typeErrorMsg, fieldType); - ArrayType arrayType = (ArrayType) fieldType; - checkArgument(arrayType.getElementType() instanceof RowType, typeErrorMsg, fieldType); - - return new FieldNestedUpdateAgg(arrayType, nestedKey); + return fieldAggregator; } - abstract String name(); + public abstract String name(); public abstract Object agg(Object accumulator, Object inputField); diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldBoolAndAgg.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldBoolAndAgg.java index 0b6371309168..5acf2595a2df 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldBoolAndAgg.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldBoolAndAgg.java @@ -32,7 +32,7 @@ public FieldBoolAndAgg(DataType dataType) { } @Override - String name() { + public String name() { return NAME; } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldBoolOrAgg.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldBoolOrAgg.java index ae385b3cc221..03a0c1c3ccb1 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldBoolOrAgg.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldBoolOrAgg.java @@ -32,7 +32,7 @@ public FieldBoolOrAgg(DataType dataType) { } @Override - String name() { + public String name() { return NAME; } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldCollectAgg.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldCollectAgg.java index ddfae4de2697..64ef223faf2c 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldCollectAgg.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldCollectAgg.java @@ -85,7 +85,7 @@ public FieldCollectAgg(ArrayType dataType, boolean distinct) { } @Override - String name() { + public String name() { return NAME; } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldFirstNonNullValueAgg.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldFirstNonNullValueAgg.java index 3d758d8f5489..0bd950bbf9d4 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldFirstNonNullValueAgg.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldFirstNonNullValueAgg.java @@ -35,7 +35,7 @@ public FieldFirstNonNullValueAgg(DataType dataType) { } @Override - String name() { + public String name() { return NAME; } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldIgnoreRetractAgg.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldIgnoreRetractAgg.java index 83f3f72a2d6b..40772c6d1259 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldIgnoreRetractAgg.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldIgnoreRetractAgg.java @@ -31,7 +31,7 @@ public FieldIgnoreRetractAgg(FieldAggregator aggregator) { } @Override - String name() { + public String name() { return aggregator.name(); } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldLastNonNullValueAgg.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldLastNonNullValueAgg.java index f069a914d64d..e189c20b2be7 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldLastNonNullValueAgg.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldLastNonNullValueAgg.java @@ -32,7 +32,7 @@ public FieldLastNonNullValueAgg(DataType dataType) { } @Override - String name() { + public String name() { return NAME; } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldLastValueAgg.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldLastValueAgg.java index 9a4a5d4de6d5..22c2b3da16de 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldLastValueAgg.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldLastValueAgg.java @@ -32,7 +32,7 @@ public FieldLastValueAgg(DataType dataType) { } @Override - String name() { + public String name() { return NAME; } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldListaggAgg.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldListaggAgg.java index 25ee8cc24cbf..3bde7e7cc5c8 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldListaggAgg.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldListaggAgg.java @@ -38,7 +38,7 @@ public FieldListaggAgg(DataType dataType, CoreOptions options, String field) { } @Override - String name() { + public String name() { return NAME; } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldMaxAgg.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldMaxAgg.java index 292c29510a4d..34e7dd139ab8 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldMaxAgg.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldMaxAgg.java @@ -34,7 +34,7 @@ public FieldMaxAgg(DataType dataType) { } @Override - String name() { + public String name() { return NAME; } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldMergeMapAgg.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldMergeMapAgg.java index 8ba78ad5e4ff..f597e8de5dd0 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldMergeMapAgg.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldMergeMapAgg.java @@ -46,7 +46,7 @@ public FieldMergeMapAgg(MapType dataType) { } @Override - String name() { + public String name() { return NAME; } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldMinAgg.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldMinAgg.java index 403724f25d73..4002966dbb2b 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldMinAgg.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldMinAgg.java @@ -34,7 +34,7 @@ public FieldMinAgg(DataType dataType) { } @Override - String name() { + public String name() { return NAME; } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldNestedUpdateAgg.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldNestedUpdateAgg.java index 1f725bb7dcfb..3cd29f127041 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldNestedUpdateAgg.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldNestedUpdateAgg.java @@ -67,7 +67,7 @@ public FieldNestedUpdateAgg(ArrayType dataType, List nestedKey) { } @Override - String name() { + public String name() { return NAME; } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldPrimaryKeyAgg.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldPrimaryKeyAgg.java index 58961bc5a603..e8053be1e627 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldPrimaryKeyAgg.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldPrimaryKeyAgg.java @@ -32,7 +32,7 @@ public FieldPrimaryKeyAgg(DataType dataType) { } @Override - String name() { + public String name() { return NAME; } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldProductAgg.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldProductAgg.java index 1a02002460df..c3fb18232dbf 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldProductAgg.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldProductAgg.java @@ -37,7 +37,7 @@ public FieldProductAgg(DataType dataType) { } @Override - String name() { + public String name() { return NAME; } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldSumAgg.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldSumAgg.java index 38081e20e222..18e4bbeaf85c 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldSumAgg.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldSumAgg.java @@ -34,7 +34,7 @@ public FieldSumAgg(DataType dataType) { } @Override - String name() { + public String name() { return NAME; } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldAggregatorFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldAggregatorFactory.java new file mode 100644 index 000000000000..44f2439fe745 --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldAggregatorFactory.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.factories.Factory; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.types.DataType; + +/** Factory for {@link FieldAggregator}. */ +public interface FieldAggregatorFactory extends Factory { + + FieldAggregator create(DataType fieldType, CoreOptions options, String field); + + String identifier(); +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldBoolAndAggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldBoolAndAggFactory.java new file mode 100644 index 000000000000..4a3a2dc88932 --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldBoolAndAggFactory.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldBoolAndAgg; +import org.apache.paimon.types.DataType; + +/** Factory for #{@link FieldBoolAndAgg}. */ +public class FieldBoolAndAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + return new FieldBoolAndAgg(fieldType); + } + + @Override + public String identifier() { + return FieldBoolAndAgg.NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldBoolOrAggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldBoolOrAggFactory.java new file mode 100644 index 000000000000..488325eaefa3 --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldBoolOrAggFactory.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldBoolOrAgg; +import org.apache.paimon.types.DataType; + +/** Factory for #{@link FieldBoolOrAgg}. */ +public class FieldBoolOrAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + return new FieldBoolOrAgg(fieldType); + } + + @Override + public String identifier() { + return FieldBoolOrAgg.NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldCollectAggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldCollectAggFactory.java new file mode 100644 index 000000000000..b20453e074f2 --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldCollectAggFactory.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldCollectAgg; +import org.apache.paimon.types.ArrayType; +import org.apache.paimon.types.DataType; + +import static org.apache.paimon.utils.Preconditions.checkArgument; + +/** Factory for #{@link FieldCollectAgg}. */ +public class FieldCollectAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + checkArgument( + fieldType instanceof ArrayType, + "Data type for collect column must be 'Array' but was '%s'.", + fieldType); + return new FieldCollectAgg((ArrayType) fieldType, options.fieldCollectAggDistinct(field)); + } + + @Override + public String identifier() { + return FieldCollectAgg.NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldFirstNonNullValueAggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldFirstNonNullValueAggFactory.java new file mode 100644 index 000000000000..141da6342487 --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldFirstNonNullValueAggFactory.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldFirstNonNullValueAgg; +import org.apache.paimon.types.DataType; + +/** Factory for #{@link FieldFirstNonNullValueAgg}. */ +public class FieldFirstNonNullValueAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + return new FieldFirstNonNullValueAgg(fieldType); + } + + @Override + public String identifier() { + return FieldFirstNonNullValueAgg.NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldFirstNonNullValueAggLegacyFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldFirstNonNullValueAggLegacyFactory.java new file mode 100644 index 000000000000..1d92dd3ec857 --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldFirstNonNullValueAggLegacyFactory.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldFirstNonNullValueAgg; +import org.apache.paimon.types.DataType; + +/** Factory for legacy name of #{@link FieldFirstNonNullValueAgg}. */ +public class FieldFirstNonNullValueAggLegacyFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + return new FieldFirstNonNullValueAgg(fieldType); + } + + @Override + public String identifier() { + return FieldFirstNonNullValueAgg.LEGACY_NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldFirstValueAggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldFirstValueAggFactory.java new file mode 100644 index 000000000000..cc36928c654e --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldFirstValueAggFactory.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldFirstValueAgg; +import org.apache.paimon.types.DataType; + +/** Factory for #{@link FieldFirstValueAgg}. */ +public class FieldFirstValueAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + return new FieldFirstValueAgg(fieldType); + } + + @Override + public String identifier() { + return FieldFirstValueAgg.NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldHllSketchAggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldHllSketchAggFactory.java new file mode 100644 index 000000000000..9f57abaee782 --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldHllSketchAggFactory.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldHllSketchAgg; +import org.apache.paimon.types.DataType; +import org.apache.paimon.types.VarBinaryType; + +import static org.apache.paimon.utils.Preconditions.checkArgument; + +/** Factory for #{@link FieldHllSketchAgg}. */ +public class FieldHllSketchAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + checkArgument( + fieldType instanceof VarBinaryType, + "Data type for hll sketch column must be 'VarBinaryType' but was '%s'.", + fieldType); + return new FieldHllSketchAgg((VarBinaryType) fieldType); + } + + @Override + public String identifier() { + return FieldHllSketchAgg.NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldLastNonNullValueAggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldLastNonNullValueAggFactory.java new file mode 100644 index 000000000000..e3e2ff079238 --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldLastNonNullValueAggFactory.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldLastNonNullValueAgg; +import org.apache.paimon.types.DataType; + +/** Factory for #{@link FieldLastNonNullValueAgg}. */ +public class FieldLastNonNullValueAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + return new FieldLastNonNullValueAgg(fieldType); + } + + @Override + public String identifier() { + return FieldLastNonNullValueAgg.NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldLastValueAggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldLastValueAggFactory.java new file mode 100644 index 000000000000..b3423a39e66d --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldLastValueAggFactory.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldLastValueAgg; +import org.apache.paimon.types.DataType; + +/** Factory for #{@link FieldLastValueAgg}. */ +public class FieldLastValueAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + return new FieldLastValueAgg(fieldType); + } + + @Override + public String identifier() { + return FieldLastValueAgg.NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldListaggAggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldListaggAggFactory.java new file mode 100644 index 000000000000..e5e85dbabdbb --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldListaggAggFactory.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldListaggAgg; +import org.apache.paimon.types.DataType; + +/** Factory for #{@link FieldListaggAgg}. */ +public class FieldListaggAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + return new FieldListaggAgg(fieldType, options, field); + } + + @Override + public String identifier() { + return FieldListaggAgg.NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldMaxAggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldMaxAggFactory.java new file mode 100644 index 000000000000..2fda49a76b4c --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldMaxAggFactory.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldMaxAgg; +import org.apache.paimon.types.DataType; + +/** Factory for #{@link FieldMaxAgg}. */ +public class FieldMaxAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + return new FieldMaxAgg(fieldType); + } + + @Override + public String identifier() { + return FieldMaxAgg.NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldMergeMapAggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldMergeMapAggFactory.java new file mode 100644 index 000000000000..ac2409b25448 --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldMergeMapAggFactory.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldMergeMapAgg; +import org.apache.paimon.types.DataType; +import org.apache.paimon.types.MapType; + +import static org.apache.paimon.utils.Preconditions.checkArgument; + +/** Factory for #{@link FieldMergeMapAgg}. */ +public class FieldMergeMapAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + checkArgument( + fieldType instanceof MapType, + "Data type of merge map column must be 'MAP' but was '%s'", + fieldType); + return new FieldMergeMapAgg((MapType) fieldType); + } + + @Override + public String identifier() { + return FieldMergeMapAgg.NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldMinAggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldMinAggFactory.java new file mode 100644 index 000000000000..e939f8a73cdd --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldMinAggFactory.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldMinAgg; +import org.apache.paimon.types.DataType; + +/** Factory for #{@link FieldMinAgg}. */ +public class FieldMinAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + return new FieldMinAgg(fieldType); + } + + @Override + public String identifier() { + return FieldMinAgg.NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldNestedUpdateAggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldNestedUpdateAggFactory.java new file mode 100644 index 000000000000..41b9f3e41775 --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldNestedUpdateAggFactory.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldNestedUpdateAgg; +import org.apache.paimon.types.ArrayType; +import org.apache.paimon.types.DataType; +import org.apache.paimon.types.RowType; + +import java.util.Collections; +import java.util.List; + +import static org.apache.paimon.utils.Preconditions.checkArgument; + +/** Factory for #{@link FieldNestedUpdateAgg}. */ +public class FieldNestedUpdateAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + return createFieldNestedUpdateAgg(fieldType, options.fieldNestedUpdateAggNestedKey(field)); + } + + @Override + public String identifier() { + return FieldNestedUpdateAgg.NAME; + } + + private static FieldAggregator createFieldNestedUpdateAgg( + DataType fieldType, List nestedKey) { + if (nestedKey == null) { + nestedKey = Collections.emptyList(); + } + + String typeErrorMsg = "Data type of nested table column must be 'Array' but was '%s'."; + checkArgument(fieldType instanceof ArrayType, typeErrorMsg, fieldType); + ArrayType arrayType = (ArrayType) fieldType; + checkArgument(arrayType.getElementType() instanceof RowType, typeErrorMsg, fieldType); + + return new FieldNestedUpdateAgg(arrayType, nestedKey); + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldPrimaryKeyAggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldPrimaryKeyAggFactory.java new file mode 100644 index 000000000000..312d29753b62 --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldPrimaryKeyAggFactory.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldPrimaryKeyAgg; +import org.apache.paimon.types.DataType; + +/** Factory for #{@link FieldPrimaryKeyAgg}. */ +public class FieldPrimaryKeyAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + return new FieldPrimaryKeyAgg(fieldType); + } + + @Override + public String identifier() { + return FieldPrimaryKeyAgg.NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldProductAggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldProductAggFactory.java new file mode 100644 index 000000000000..88be9c42a218 --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldProductAggFactory.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldProductAgg; +import org.apache.paimon.types.DataType; + +/** Factory for #{@link FieldProductAgg}. */ +public class FieldProductAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + return new FieldProductAgg(fieldType); + } + + @Override + public String identifier() { + return FieldProductAgg.NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldRoaringBitmap32AggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldRoaringBitmap32AggFactory.java new file mode 100644 index 000000000000..5b2a80b30817 --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldRoaringBitmap32AggFactory.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldRoaringBitmap32Agg; +import org.apache.paimon.types.DataType; +import org.apache.paimon.types.VarBinaryType; + +import static org.apache.paimon.utils.Preconditions.checkArgument; + +/** Factory for #{@link FieldRoaringBitmap32Agg}. */ +public class FieldRoaringBitmap32AggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + checkArgument( + fieldType instanceof VarBinaryType, + "Data type for roaring bitmap column must be 'VarBinaryType' but was '%s'.", + fieldType); + return new FieldRoaringBitmap32Agg((VarBinaryType) fieldType); + } + + @Override + public String identifier() { + return FieldRoaringBitmap32Agg.NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldRoaringBitmap64AggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldRoaringBitmap64AggFactory.java new file mode 100644 index 000000000000..a0e9fe652094 --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldRoaringBitmap64AggFactory.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldRoaringBitmap64Agg; +import org.apache.paimon.types.DataType; +import org.apache.paimon.types.VarBinaryType; + +import static org.apache.paimon.utils.Preconditions.checkArgument; + +/** Factory for #{@link FieldRoaringBitmap64Agg}. */ +public class FieldRoaringBitmap64AggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + checkArgument( + fieldType instanceof VarBinaryType, + "Data type for roaring bitmap column must be 'VarBinaryType' but was '%s'.", + fieldType); + return new FieldRoaringBitmap64Agg((VarBinaryType) fieldType); + } + + @Override + public String identifier() { + return FieldRoaringBitmap64Agg.NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldSumAggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldSumAggFactory.java new file mode 100644 index 000000000000..8470e6d1752c --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldSumAggFactory.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldSumAgg; +import org.apache.paimon.types.DataType; + +/** Factory for #{@link FieldSumAgg}. */ +public class FieldSumAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + return new FieldSumAgg(fieldType); + } + + @Override + public String identifier() { + return FieldSumAgg.NAME; + } +} diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldThetaSketchAggFactory.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldThetaSketchAggFactory.java new file mode 100644 index 000000000000..6aa5d7bc423f --- /dev/null +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/factory/FieldThetaSketchAggFactory.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate.factory; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.FieldAggregator; +import org.apache.paimon.mergetree.compact.aggregate.FieldThetaSketchAgg; +import org.apache.paimon.types.DataType; +import org.apache.paimon.types.VarBinaryType; + +import static org.apache.paimon.utils.Preconditions.checkArgument; + +/** Factory for #{@link FieldThetaSketchAgg}. */ +public class FieldThetaSketchAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + checkArgument( + fieldType instanceof VarBinaryType, + "Data type for theta sketch column must be 'VarBinaryType' but was '%s'.", + fieldType); + return new FieldThetaSketchAgg((VarBinaryType) fieldType); + } + + @Override + public String identifier() { + return FieldThetaSketchAgg.NAME; + } +} diff --git a/paimon-core/src/main/resources/META-INF/services/org.apache.paimon.factories.Factory b/paimon-core/src/main/resources/META-INF/services/org.apache.paimon.factories.Factory index 0f87c96b0d4e..ac6cc98fed6b 100644 --- a/paimon-core/src/main/resources/META-INF/services/org.apache.paimon.factories.Factory +++ b/paimon-core/src/main/resources/META-INF/services/org.apache.paimon.factories.Factory @@ -16,3 +16,23 @@ org.apache.paimon.catalog.FileSystemCatalogFactory org.apache.paimon.jdbc.JdbcCatalogFactory org.apache.paimon.jdbc.JdbcCatalogLockFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldBoolAndAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldBoolOrAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldCollectAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldFirstNonNullValueAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldFirstNonNullValueAggLegacyFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldFirstValueAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldHllSketchAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldLastNonNullValueAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldLastValueAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldListaggAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldMaxAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldMergeMapAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldMinAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldNestedUpdateAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldPrimaryKeyAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldProductAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldRoaringBitmap32AggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldRoaringBitmap64AggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldSumAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldThetaSketchAggFactory diff --git a/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/aggregate/FieldAggregatorTest.java b/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/aggregate/FieldAggregatorTest.java index 2d9a03b74d62..0fa1433e78e1 100644 --- a/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/aggregate/FieldAggregatorTest.java +++ b/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/aggregate/FieldAggregatorTest.java @@ -810,6 +810,21 @@ public void testFieldRoaringBitmap64Agg() throws IOException { assertThat(result4).isEqualTo(acc2); } + @Test + public void testCustomAgg() throws IOException { + FieldAggregator fieldAggregator = + FieldAggregator.createFieldAggregator( + DataTypes.STRING(), + "custom", + false, + false, + CoreOptions.fromMap(new HashMap<>()), + "custom"); + + Object agg = fieldAggregator.agg("test", "test"); + assertThat(agg).isEqualTo("test"); + } + private Map toMap(Object... kvs) { Map result = new HashMap<>(); for (int i = 0; i < kvs.length; i += 2) { diff --git a/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/aggregate/TestCostomAgg.java b/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/aggregate/TestCostomAgg.java new file mode 100644 index 000000000000..aedf6a373dab --- /dev/null +++ b/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/aggregate/TestCostomAgg.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate; + +import org.apache.paimon.types.DataType; + +/** Custom FieldAggregator for Test. */ +public class TestCostomAgg extends FieldAggregator { + public TestCostomAgg(DataType dataType) { + super(dataType); + } + + @Override + public String name() { + return "custom"; + } + + @Override + public Object agg(Object accumulator, Object inputField) { + return inputField; + } +} diff --git a/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/aggregate/TestCostomAggFactory.java b/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/aggregate/TestCostomAggFactory.java new file mode 100644 index 000000000000..e8884bfb50ae --- /dev/null +++ b/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/aggregate/TestCostomAggFactory.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.paimon.mergetree.compact.aggregate; + +import org.apache.paimon.CoreOptions; +import org.apache.paimon.mergetree.compact.aggregate.factory.FieldAggregatorFactory; +import org.apache.paimon.types.DataType; + +/** FieldAggregatorFactory for test. */ +public class TestCostomAggFactory implements FieldAggregatorFactory { + @Override + public FieldAggregator create(DataType fieldType, CoreOptions options, String field) { + return new TestCostomAgg(fieldType); + } + + @Override + public String identifier() { + return "custom"; + } +} diff --git a/paimon-core/src/test/resources/META-INF/services/org.apache.paimon.factories.Factory b/paimon-core/src/test/resources/META-INF/services/org.apache.paimon.factories.Factory new file mode 100644 index 000000000000..3b85790c7364 --- /dev/null +++ b/paimon-core/src/test/resources/META-INF/services/org.apache.paimon.factories.Factory @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +org.apache.paimon.mergetree.compact.aggregate.factory.FieldBoolAndAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldBoolOrAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldCollectAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldFirstNonNullValueAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldFirstNonNullValueAggLegacyFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldFirstValueAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldHllSketchAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldLastNonNullValueAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldLastValueAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldListaggAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldMaxAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldMergeMapAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldMinAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldNestedUpdateAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldPrimaryKeyAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldProductAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldRoaringBitmap32AggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldRoaringBitmap64AggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldSumAggFactory +org.apache.paimon.mergetree.compact.aggregate.factory.FieldThetaSketchAggFactory +org.apache.paimon.mergetree.compact.aggregate.TestCostomAggFactory \ No newline at end of file