From a0540bd55cda57bac573d77902973f187ed9fb2d Mon Sep 17 00:00:00 2001 From: xiedeyantu Date: Sat, 23 Mar 2024 21:54:26 +0800 Subject: [PATCH] fix style --- .../catalog/BuiltinAggregateFunctions.java | 56 +++++++++- .../org/apache/doris/catalog/FunctionSet.java | 100 +++++++++--------- .../visitor/AggregateFunctionVisitor.java | 58 +++++++++- 3 files changed, 162 insertions(+), 52 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinAggregateFunctions.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinAggregateFunctions.java index 79404a85746fe8..49e6d66f50e1e2 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinAggregateFunctions.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinAggregateFunctions.java @@ -17,7 +17,61 @@ package org.apache.doris.catalog; -import org.apache.doris.nereids.trees.expressions.functions.agg.*; +import org.apache.doris.nereids.trees.expressions.functions.agg.AnyValue; +import org.apache.doris.nereids.trees.expressions.functions.agg.ArrayAgg; +import org.apache.doris.nereids.trees.expressions.functions.agg.Avg; +import org.apache.doris.nereids.trees.expressions.functions.agg.AvgWeighted; +import org.apache.doris.nereids.trees.expressions.functions.agg.BitmapAgg; +import org.apache.doris.nereids.trees.expressions.functions.agg.BitmapIntersect; +import org.apache.doris.nereids.trees.expressions.functions.agg.BitmapUnion; +import org.apache.doris.nereids.trees.expressions.functions.agg.BitmapUnionCount; +import org.apache.doris.nereids.trees.expressions.functions.agg.BitmapUnionInt; +import org.apache.doris.nereids.trees.expressions.functions.agg.CollectList; +import org.apache.doris.nereids.trees.expressions.functions.agg.CollectSet; +import org.apache.doris.nereids.trees.expressions.functions.agg.Corr; +import org.apache.doris.nereids.trees.expressions.functions.agg.Count; +import org.apache.doris.nereids.trees.expressions.functions.agg.CountByEnum; +import org.apache.doris.nereids.trees.expressions.functions.agg.Covar; +import org.apache.doris.nereids.trees.expressions.functions.agg.CovarSamp; +import org.apache.doris.nereids.trees.expressions.functions.agg.GroupBitAnd; +import org.apache.doris.nereids.trees.expressions.functions.agg.GroupBitOr; +import org.apache.doris.nereids.trees.expressions.functions.agg.GroupBitXor; +import org.apache.doris.nereids.trees.expressions.functions.agg.GroupBitmapXor; +import org.apache.doris.nereids.trees.expressions.functions.agg.GroupConcat; +import org.apache.doris.nereids.trees.expressions.functions.agg.Histogram; +import org.apache.doris.nereids.trees.expressions.functions.agg.HllUnion; +import org.apache.doris.nereids.trees.expressions.functions.agg.HllUnionAgg; +import org.apache.doris.nereids.trees.expressions.functions.agg.IntersectCount; +import org.apache.doris.nereids.trees.expressions.functions.agg.MapAgg; +import org.apache.doris.nereids.trees.expressions.functions.agg.Max; +import org.apache.doris.nereids.trees.expressions.functions.agg.MaxBy; +import org.apache.doris.nereids.trees.expressions.functions.agg.Min; +import org.apache.doris.nereids.trees.expressions.functions.agg.MinBy; +import org.apache.doris.nereids.trees.expressions.functions.agg.MultiDistinctCount; +import org.apache.doris.nereids.trees.expressions.functions.agg.MultiDistinctGroupConcat; +import org.apache.doris.nereids.trees.expressions.functions.agg.MultiDistinctSum; +import org.apache.doris.nereids.trees.expressions.functions.agg.MultiDistinctSum0; +import org.apache.doris.nereids.trees.expressions.functions.agg.Ndv; +import org.apache.doris.nereids.trees.expressions.functions.agg.OrthogonalBitmapIntersect; +import org.apache.doris.nereids.trees.expressions.functions.agg.OrthogonalBitmapIntersectCount; +import org.apache.doris.nereids.trees.expressions.functions.agg.OrthogonalBitmapUnionCount; +import org.apache.doris.nereids.trees.expressions.functions.agg.Percentile; +import org.apache.doris.nereids.trees.expressions.functions.agg.PercentileApprox; +import org.apache.doris.nereids.trees.expressions.functions.agg.PercentileArray; +import org.apache.doris.nereids.trees.expressions.functions.agg.QuantileUnion; +import org.apache.doris.nereids.trees.expressions.functions.agg.Retention; +import org.apache.doris.nereids.trees.expressions.functions.agg.SequenceCount; +import org.apache.doris.nereids.trees.expressions.functions.agg.SequenceMatch; +import org.apache.doris.nereids.trees.expressions.functions.agg.Stddev; +import org.apache.doris.nereids.trees.expressions.functions.agg.StddevSamp; +import org.apache.doris.nereids.trees.expressions.functions.agg.Sum; +import org.apache.doris.nereids.trees.expressions.functions.agg.Sum0; +import org.apache.doris.nereids.trees.expressions.functions.agg.TopN; +import org.apache.doris.nereids.trees.expressions.functions.agg.TopNArray; +import org.apache.doris.nereids.trees.expressions.functions.agg.TopNWeighted; +import org.apache.doris.nereids.trees.expressions.functions.agg.Variance; +import org.apache.doris.nereids.trees.expressions.functions.agg.VarianceSamp; +import org.apache.doris.nereids.trees.expressions.functions.agg.WindowFunnel; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java index b5ae304b7555de..29ff913b8aabac 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java @@ -936,16 +936,16 @@ private void initAggregateBuiltins() { "", false, true, false, true)); addBuiltin(AggregateFunction.createBuiltin("multi_distinct_sum0", Lists.newArrayList(t), - t, - t, - "", - "", - "", - "", - null, - null, - "", - false, true, true, true)); + t, + t, + "", + "", + "", + "", + null, + null, + "", + false, true, true, true)); } else if (t.equals(Type.MAX_DECIMALV2_TYPE)) { // vectorized addBuiltin(AggregateFunction.createBuiltin("multi_distinct_sum", Lists.newArrayList(t), @@ -960,16 +960,16 @@ private void initAggregateBuiltins() { "", false, true, false, true)); addBuiltin(AggregateFunction.createBuiltin("multi_distinct_sum0", Lists.newArrayList(t), - MULTI_DISTINCT_SUM_RETURN_TYPE.get(t), - Type.MAX_DECIMALV2_TYPE, - "", - "", - "", - "", - null, - null, - "", - false, true, true, true)); + MULTI_DISTINCT_SUM_RETURN_TYPE.get(t), + Type.MAX_DECIMALV2_TYPE, + "", + "", + "", + "", + null, + null, + "", + false, true, true, true)); } else if (t.equals(Type.DECIMAL32)) { // vectorized addBuiltin(AggregateFunction.createBuiltin("multi_distinct_sum", Lists.newArrayList(t), @@ -984,16 +984,16 @@ private void initAggregateBuiltins() { "", false, true, false, true)); addBuiltin(AggregateFunction.createBuiltin("multi_distinct_sum0", Lists.newArrayList(t), - MULTI_DISTINCT_SUM_RETURN_TYPE.get(t), - Type.DECIMAL32, - "", - "", - "", - "", - null, - null, - "", - false, true, true, true)); + MULTI_DISTINCT_SUM_RETURN_TYPE.get(t), + Type.DECIMAL32, + "", + "", + "", + "", + null, + null, + "", + false, true, true, true)); } else if (t.equals(Type.DECIMAL64)) { addBuiltin(AggregateFunction.createBuiltin("multi_distinct_sum", Lists.newArrayList(t), MULTI_DISTINCT_SUM_RETURN_TYPE.get(t), @@ -1007,16 +1007,16 @@ private void initAggregateBuiltins() { "", false, true, false, true)); addBuiltin(AggregateFunction.createBuiltin("multi_distinct_sum0", Lists.newArrayList(t), - MULTI_DISTINCT_SUM_RETURN_TYPE.get(t), - Type.DECIMAL64, - "", - "", - "", - "", - null, - null, - "", - false, true, true, true)); + MULTI_DISTINCT_SUM_RETURN_TYPE.get(t), + Type.DECIMAL64, + "", + "", + "", + "", + null, + null, + "", + false, true, true, true)); } else if (t.equals(Type.DECIMAL128)) { addBuiltin(AggregateFunction.createBuiltin("multi_distinct_sum", Lists.newArrayList(t), MULTI_DISTINCT_SUM_RETURN_TYPE.get(t), @@ -1030,16 +1030,16 @@ private void initAggregateBuiltins() { "", false, true, false, true)); addBuiltin(AggregateFunction.createBuiltin("multi_distinct_sum0", Lists.newArrayList(t), - MULTI_DISTINCT_SUM_RETURN_TYPE.get(t), - Type.DECIMAL128, - "", - "", - "", - "", - null, - null, - "", - false, true, true, true)); + MULTI_DISTINCT_SUM_RETURN_TYPE.get(t), + Type.DECIMAL128, + "", + "", + "", + "", + null, + null, + "", + false, true, true, true)); } // Min addBuiltin(AggregateFunction.createBuiltin("min", diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/visitor/AggregateFunctionVisitor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/visitor/AggregateFunctionVisitor.java index a9a6caf2c98a34..febe93974f264a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/visitor/AggregateFunctionVisitor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/visitor/AggregateFunctionVisitor.java @@ -17,7 +17,63 @@ package org.apache.doris.nereids.trees.expressions.visitor; -import org.apache.doris.nereids.trees.expressions.functions.agg.*; +import org.apache.doris.nereids.trees.expressions.functions.agg.AggregateFunction; +import org.apache.doris.nereids.trees.expressions.functions.agg.AnyValue; +import org.apache.doris.nereids.trees.expressions.functions.agg.ArrayAgg; +import org.apache.doris.nereids.trees.expressions.functions.agg.Avg; +import org.apache.doris.nereids.trees.expressions.functions.agg.AvgWeighted; +import org.apache.doris.nereids.trees.expressions.functions.agg.BitmapAgg; +import org.apache.doris.nereids.trees.expressions.functions.agg.BitmapIntersect; +import org.apache.doris.nereids.trees.expressions.functions.agg.BitmapUnion; +import org.apache.doris.nereids.trees.expressions.functions.agg.BitmapUnionCount; +import org.apache.doris.nereids.trees.expressions.functions.agg.BitmapUnionInt; +import org.apache.doris.nereids.trees.expressions.functions.agg.CollectList; +import org.apache.doris.nereids.trees.expressions.functions.agg.CollectSet; +import org.apache.doris.nereids.trees.expressions.functions.agg.Corr; +import org.apache.doris.nereids.trees.expressions.functions.agg.Count; +import org.apache.doris.nereids.trees.expressions.functions.agg.CountByEnum; +import org.apache.doris.nereids.trees.expressions.functions.agg.Covar; +import org.apache.doris.nereids.trees.expressions.functions.agg.CovarSamp; +import org.apache.doris.nereids.trees.expressions.functions.agg.GroupBitAnd; +import org.apache.doris.nereids.trees.expressions.functions.agg.GroupBitOr; +import org.apache.doris.nereids.trees.expressions.functions.agg.GroupBitXor; +import org.apache.doris.nereids.trees.expressions.functions.agg.GroupBitmapXor; +import org.apache.doris.nereids.trees.expressions.functions.agg.GroupConcat; +import org.apache.doris.nereids.trees.expressions.functions.agg.Histogram; +import org.apache.doris.nereids.trees.expressions.functions.agg.HllUnion; +import org.apache.doris.nereids.trees.expressions.functions.agg.HllUnionAgg; +import org.apache.doris.nereids.trees.expressions.functions.agg.IntersectCount; +import org.apache.doris.nereids.trees.expressions.functions.agg.MapAgg; +import org.apache.doris.nereids.trees.expressions.functions.agg.Max; +import org.apache.doris.nereids.trees.expressions.functions.agg.MaxBy; +import org.apache.doris.nereids.trees.expressions.functions.agg.Min; +import org.apache.doris.nereids.trees.expressions.functions.agg.MinBy; +import org.apache.doris.nereids.trees.expressions.functions.agg.MultiDistinctCount; +import org.apache.doris.nereids.trees.expressions.functions.agg.MultiDistinctGroupConcat; +import org.apache.doris.nereids.trees.expressions.functions.agg.MultiDistinctSum; +import org.apache.doris.nereids.trees.expressions.functions.agg.MultiDistinctSum0; +import org.apache.doris.nereids.trees.expressions.functions.agg.Ndv; +import org.apache.doris.nereids.trees.expressions.functions.agg.NullableAggregateFunction; +import org.apache.doris.nereids.trees.expressions.functions.agg.OrthogonalBitmapIntersect; +import org.apache.doris.nereids.trees.expressions.functions.agg.OrthogonalBitmapIntersectCount; +import org.apache.doris.nereids.trees.expressions.functions.agg.OrthogonalBitmapUnionCount; +import org.apache.doris.nereids.trees.expressions.functions.agg.Percentile; +import org.apache.doris.nereids.trees.expressions.functions.agg.PercentileApprox; +import org.apache.doris.nereids.trees.expressions.functions.agg.PercentileArray; +import org.apache.doris.nereids.trees.expressions.functions.agg.QuantileUnion; +import org.apache.doris.nereids.trees.expressions.functions.agg.Retention; +import org.apache.doris.nereids.trees.expressions.functions.agg.SequenceCount; +import org.apache.doris.nereids.trees.expressions.functions.agg.SequenceMatch; +import org.apache.doris.nereids.trees.expressions.functions.agg.Stddev; +import org.apache.doris.nereids.trees.expressions.functions.agg.StddevSamp; +import org.apache.doris.nereids.trees.expressions.functions.agg.Sum; +import org.apache.doris.nereids.trees.expressions.functions.agg.Sum0; +import org.apache.doris.nereids.trees.expressions.functions.agg.TopN; +import org.apache.doris.nereids.trees.expressions.functions.agg.TopNArray; +import org.apache.doris.nereids.trees.expressions.functions.agg.TopNWeighted; +import org.apache.doris.nereids.trees.expressions.functions.agg.Variance; +import org.apache.doris.nereids.trees.expressions.functions.agg.VarianceSamp; +import org.apache.doris.nereids.trees.expressions.functions.agg.WindowFunnel; import org.apache.doris.nereids.trees.expressions.functions.combinator.ForEachCombinator; import org.apache.doris.nereids.trees.expressions.functions.combinator.MergeCombinator; import org.apache.doris.nereids.trees.expressions.functions.combinator.UnionCombinator;