This is an automated email from the ASF dual-hosted git repository.
panxiaolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 6b51eb2a373 [Chore](agg) adjust skew kurtosis linerhistogram group_bit
symbols (#54509)
6b51eb2a373 is described below
commit 6b51eb2a37302b254f324f2a56c03477708eff91
Author: Pxl <[email protected]>
AuthorDate: Mon Aug 11 11:28:01 2025 +0800
[Chore](agg) adjust skew kurtosis linerhistogram group_bit symbols (#54509)
adjust skew kurtosis linerhistogram group_bit symbols
---
.../aggregate_function_approx_count_distinct.cpp | 2 +-
.../aggregate_functions/aggregate_function_bit.cpp | 15 +++--
.../aggregate_function_histogram.cpp | 24 +++----
.../aggregate_function_kurtosis.cpp | 66 ++++--------------
.../aggregate_function_linear_histogram.cpp | 74 ++++-----------------
.../aggregate_function_skew.cpp | 66 ++++--------------
.../vec/aggregate_functions/agg_histogram_test.cpp | 7 --
.../agg_linear_histogram_test.cpp | 3 -
.../trees/expressions/functions/agg/Kurt.java | 12 +---
.../trees/expressions/functions/agg/Skew.java | 12 +---
.../test_aggregate_histogram.out | Bin 14353 -> 13643 bytes
.../nereids_function_p0/agg_function/agg.groovy | 27 --------
.../test_aggregate_histogram.groovy | 1 -
.../test_aggregate_histogram.groovy | 4 --
14 files changed, 62 insertions(+), 251 deletions(-)
diff --git
a/be/src/vec/aggregate_functions/aggregate_function_approx_count_distinct.cpp
b/be/src/vec/aggregate_functions/aggregate_function_approx_count_distinct.cpp
index 3e9a346385d..4bc5da2ac72 100644
---
a/be/src/vec/aggregate_functions/aggregate_function_approx_count_distinct.cpp
+++
b/be/src/vec/aggregate_functions/aggregate_function_approx_count_distinct.cpp
@@ -30,7 +30,7 @@ AggregateFunctionPtr
create_aggregate_function_approx_count_distinct(
return creator_with_type_list<
TYPE_BOOLEAN, TYPE_TINYINT, TYPE_SMALLINT, TYPE_INT, TYPE_BIGINT,
TYPE_LARGEINT,
TYPE_FLOAT, TYPE_DOUBLE, TYPE_DECIMAL32, TYPE_DECIMAL64,
TYPE_DECIMAL128I,
- TYPE_DECIMALV2, TYPE_DECIMAL256, TYPE_VARCHAR, TYPE_DATEV2,
TYPE_DATETIMEV2, TYPE_IPV4,
+ TYPE_DECIMAL256, TYPE_VARCHAR, TYPE_DATEV2, TYPE_DATETIMEV2,
TYPE_IPV4,
TYPE_IPV6>::create<AggregateFunctionApproxCountDistinct>(argument_types,
result_is_nullable, attr);
}
diff --git a/be/src/vec/aggregate_functions/aggregate_function_bit.cpp
b/be/src/vec/aggregate_functions/aggregate_function_bit.cpp
index 981ced1fbd5..02ef6ca980c 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_bit.cpp
+++ b/be/src/vec/aggregate_functions/aggregate_function_bit.cpp
@@ -20,6 +20,7 @@
#include "vec/aggregate_functions/aggregate_function_bit.h"
+#include "runtime/define_primitive_type.h"
#include "vec/aggregate_functions/aggregate_function_simple_factory.h"
#include "vec/aggregate_functions/helpers.h"
@@ -27,15 +28,17 @@ namespace doris::vectorized {
#include "common/compile_check_begin.h"
void register_aggregate_function_bit(AggregateFunctionSimpleFactory& factory) {
+ using creator = creator_with_type_list<TYPE_TINYINT, TYPE_SMALLINT,
TYPE_INT, TYPE_BIGINT,
+ TYPE_LARGEINT>;
factory.register_function_both(
- "group_bit_or",
creator_with_integer_type::creator<AggregateFunctionBitwise,
-
AggregateFunctionGroupBitOrData>);
+ "group_bit_or",
+ creator::creator<AggregateFunctionBitwise,
AggregateFunctionGroupBitOrData>);
factory.register_function_both(
- "group_bit_and",
creator_with_integer_type::creator<AggregateFunctionBitwise,
-
AggregateFunctionGroupBitAndData>);
+ "group_bit_and",
+ creator::creator<AggregateFunctionBitwise,
AggregateFunctionGroupBitAndData>);
factory.register_function_both(
- "group_bit_xor",
creator_with_integer_type::creator<AggregateFunctionBitwise,
-
AggregateFunctionGroupBitXorData>);
+ "group_bit_xor",
+ creator::creator<AggregateFunctionBitwise,
AggregateFunctionGroupBitXorData>);
}
} // namespace doris::vectorized
\ No newline at end of file
diff --git a/be/src/vec/aggregate_functions/aggregate_function_histogram.cpp
b/be/src/vec/aggregate_functions/aggregate_function_histogram.cpp
index ed3c997a6cc..cf1ed9f8a84 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_histogram.cpp
+++ b/be/src/vec/aggregate_functions/aggregate_function_histogram.cpp
@@ -20,6 +20,8 @@
#include <fmt/format.h>
#include <glog/logging.h>
+#include "runtime/define_primitive_type.h"
+#include "vec/aggregate_functions/factory_helpers.h"
#include "vec/aggregate_functions/helpers.h"
#include "vec/data_types/data_type.h"
@@ -36,24 +38,18 @@ AggregateFunctionPtr
create_aggregate_function_histogram(const std::string& name
const DataTypes&
argument_types,
const bool
result_is_nullable,
const
AggregateFunctionAttr& attr) {
- AggregateFunctionPtr result;
+ assert_arity_range(name, argument_types, 1, 2);
+ using creator = creator_with_type_list<TYPE_TINYINT, TYPE_SMALLINT,
TYPE_INT, TYPE_BIGINT,
+ TYPE_LARGEINT, TYPE_FLOAT,
TYPE_DOUBLE, TYPE_DECIMAL32,
+ TYPE_DECIMAL64, TYPE_DECIMAL128I,
TYPE_DECIMAL256,
+ TYPE_VARCHAR, TYPE_DATEV2,
TYPE_DATETIMEV2>;
if (argument_types.size() == 2) {
- result = creator_with_any::create<HistogramWithInputParam,
AggregateFunctionHistogramData>(
- argument_types, result_is_nullable, attr);
- } else if (argument_types.size() == 1) {
- result = creator_with_any::create<HistogramNormal,
AggregateFunctionHistogramData>(
+ return creator::create<HistogramWithInputParam,
AggregateFunctionHistogramData>(
argument_types, result_is_nullable, attr);
} else {
- throw Exception(ErrorCode::INVALID_ARGUMENT,
- "Aggregate function histogram requires 1 or 2
arguments, but got {}",
- argument_types.size());
- }
- if (!result) {
- throw Exception(ErrorCode::NOT_IMPLEMENTED_ERROR,
- "Aggregate function histogram does not support type
{}",
- argument_types[0]->get_primitive_type());
+ return creator::create<HistogramNormal,
AggregateFunctionHistogramData>(
+ argument_types, result_is_nullable, attr);
}
- return result;
}
void register_aggregate_function_histogram(AggregateFunctionSimpleFactory&
factory) {
diff --git a/be/src/vec/aggregate_functions/aggregate_function_kurtosis.cpp
b/be/src/vec/aggregate_functions/aggregate_function_kurtosis.cpp
index 0ef0b42cfe6..6c6c0f0ca15 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_kurtosis.cpp
+++ b/be/src/vec/aggregate_functions/aggregate_function_kurtosis.cpp
@@ -18,18 +18,25 @@
#include "vec/aggregate_functions/aggregate_function.h"
#include "vec/aggregate_functions/aggregate_function_simple_factory.h"
#include "vec/aggregate_functions/aggregate_function_statistic.h"
+#include "vec/aggregate_functions/factory_helpers.h"
#include "vec/aggregate_functions/helpers.h"
#include "vec/data_types/data_type.h"
namespace doris::vectorized {
#include "common/compile_check_begin.h"
-template <PrimitiveType T>
-AggregateFunctionPtr type_dispatch_for_aggregate_function_kurt(const
DataTypes& argument_types,
- const bool
result_is_nullable,
- bool
nullable_input,
- const
AggregateFunctionAttr& attr) {
- using StatFunctionTemplate = StatFuncOneArg<T, 4>;
+AggregateFunctionPtr create_aggregate_function_kurt(const std::string& name,
+ const DataTypes&
argument_types,
+ const bool
result_is_nullable,
+ const
AggregateFunctionAttr& attr) {
+ assert_arity_range(name, argument_types, 1, 1);
+ if (!result_is_nullable) {
+ throw doris::Exception(ErrorCode::INTERNAL_ERROR,
+ "Aggregate function {} requires
result_is_nullable", name);
+ }
+
+ const bool nullable_input = argument_types[0]->is_nullable();
+ using StatFunctionTemplate = StatFuncOneArg<TYPE_DOUBLE, 4>;
if (nullable_input) {
return creator_without_type::create_ignore_nullable<
@@ -40,53 +47,6 @@ AggregateFunctionPtr
type_dispatch_for_aggregate_function_kurt(const DataTypes&
AggregateFunctionVarianceSimple<StatFunctionTemplate, false>>(
argument_types, result_is_nullable, attr,
STATISTICS_FUNCTION_KIND::KURT_POP);
}
-};
-
-AggregateFunctionPtr create_aggregate_function_kurt(const std::string& name,
- const DataTypes&
argument_types,
- const bool
result_is_nullable,
- const
AggregateFunctionAttr& attr) {
- if (argument_types.size() != 1) {
- LOG(WARNING) << "aggregate function " << name << " requires exactly 1
argument";
- return nullptr;
- }
-
- if (!result_is_nullable) {
- LOG(WARNING) << "aggregate function " << name << " requires nullable
result type";
- return nullptr;
- }
-
- const bool nullable_input = argument_types[0]->is_nullable();
- switch (argument_types[0]->get_primitive_type()) {
- case PrimitiveType::TYPE_BOOLEAN:
- return type_dispatch_for_aggregate_function_kurt<TYPE_BOOLEAN>(
- argument_types, result_is_nullable, nullable_input, attr);
- case PrimitiveType::TYPE_TINYINT:
- return type_dispatch_for_aggregate_function_kurt<TYPE_TINYINT>(
- argument_types, result_is_nullable, nullable_input, attr);
- case PrimitiveType::TYPE_SMALLINT:
- return type_dispatch_for_aggregate_function_kurt<TYPE_SMALLINT>(
- argument_types, result_is_nullable, nullable_input, attr);
- case PrimitiveType::TYPE_INT:
- return type_dispatch_for_aggregate_function_kurt<TYPE_INT>(
- argument_types, result_is_nullable, nullable_input, attr);
- case PrimitiveType::TYPE_BIGINT:
- return type_dispatch_for_aggregate_function_kurt<TYPE_BIGINT>(
- argument_types, result_is_nullable, nullable_input, attr);
- case PrimitiveType::TYPE_LARGEINT:
- return type_dispatch_for_aggregate_function_kurt<TYPE_LARGEINT>(
- argument_types, result_is_nullable, nullable_input, attr);
- case PrimitiveType::TYPE_FLOAT:
- return type_dispatch_for_aggregate_function_kurt<TYPE_FLOAT>(
- argument_types, result_is_nullable, nullable_input, attr);
- case PrimitiveType::TYPE_DOUBLE:
- return type_dispatch_for_aggregate_function_kurt<TYPE_DOUBLE>(
- argument_types, result_is_nullable, nullable_input, attr);
- default:
- LOG(WARNING) << "unsupported input type " <<
argument_types[0]->get_name()
- << " for aggregate function " << name;
- return nullptr;
- }
}
void register_aggregate_function_kurtosis(AggregateFunctionSimpleFactory&
factory) {
diff --git
a/be/src/vec/aggregate_functions/aggregate_function_linear_histogram.cpp
b/be/src/vec/aggregate_functions/aggregate_function_linear_histogram.cpp
index cf22f6b47ef..a140159c554 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_linear_histogram.cpp
+++ b/be/src/vec/aggregate_functions/aggregate_function_linear_histogram.cpp
@@ -24,72 +24,26 @@ namespace doris::vectorized {
const std::string AggregateFunctionLinearHistogramConsts::NAME =
"linear_histogram";
-template <PrimitiveType T>
-AggregateFunctionPtr create_agg_function_linear_histogram(const DataTypes&
argument_types,
- const bool
result_is_nullable,
- const
AggregateFunctionAttr& attr) {
- bool has_offset = (argument_types.size() == 3);
+template <PrimitiveType T, typename Data>
+using HistogramWithInputParam = AggregateFunctionLinearHistogram<T, Data,
true>;
- if (has_offset) {
- return creator_without_type::create<
- AggregateFunctionLinearHistogram<T,
AggregateFunctionLinearHistogramData<T>, true>>(
- argument_types, result_is_nullable, attr);
- } else {
- return creator_without_type::create<AggregateFunctionLinearHistogram<
- T, AggregateFunctionLinearHistogramData<T>,
false>>(argument_types,
-
result_is_nullable, attr);
- }
-}
+template <PrimitiveType T, typename Data>
+using HistogramNormal = AggregateFunctionLinearHistogram<T, Data, false>;
AggregateFunctionPtr create_aggregate_function_linear_histogram(const
std::string& name,
const
DataTypes& argument_types,
const bool
result_is_nullable,
const
AggregateFunctionAttr& attr) {
- switch (argument_types[0]->get_primitive_type()) {
- case PrimitiveType::TYPE_BOOLEAN:
- return
create_agg_function_linear_histogram<TYPE_BOOLEAN>(argument_types,
-
result_is_nullable, attr);
- case PrimitiveType::TYPE_TINYINT:
- return
create_agg_function_linear_histogram<TYPE_TINYINT>(argument_types,
-
result_is_nullable, attr);
- case PrimitiveType::TYPE_SMALLINT:
- return
create_agg_function_linear_histogram<TYPE_SMALLINT>(argument_types,
-
result_is_nullable, attr);
- case PrimitiveType::TYPE_INT:
- return create_agg_function_linear_histogram<TYPE_INT>(argument_types,
result_is_nullable,
- attr);
- case PrimitiveType::TYPE_BIGINT:
- return
create_agg_function_linear_histogram<TYPE_BIGINT>(argument_types,
result_is_nullable,
- attr);
- case PrimitiveType::TYPE_LARGEINT:
- return
create_agg_function_linear_histogram<TYPE_LARGEINT>(argument_types,
-
result_is_nullable, attr);
- case PrimitiveType::TYPE_FLOAT:
- return
create_agg_function_linear_histogram<TYPE_FLOAT>(argument_types,
result_is_nullable,
- attr);
- case PrimitiveType::TYPE_DOUBLE:
- return
create_agg_function_linear_histogram<TYPE_DOUBLE>(argument_types,
result_is_nullable,
- attr);
- case PrimitiveType::TYPE_DECIMAL32:
- return
create_agg_function_linear_histogram<TYPE_DECIMAL32>(argument_types,
-
result_is_nullable, attr);
- case PrimitiveType::TYPE_DECIMAL64:
- return
create_agg_function_linear_histogram<TYPE_DECIMAL64>(argument_types,
-
result_is_nullable, attr);
- case PrimitiveType::TYPE_DECIMAL128I:
- return
create_agg_function_linear_histogram<TYPE_DECIMAL128I>(argument_types,
-
result_is_nullable, attr);
- case PrimitiveType::TYPE_DECIMALV2:
- return
create_agg_function_linear_histogram<TYPE_DECIMALV2>(argument_types,
-
result_is_nullable, attr);
- case PrimitiveType::TYPE_DECIMAL256:
- return
create_agg_function_linear_histogram<TYPE_DECIMAL256>(argument_types,
-
result_is_nullable, attr);
- default:
-
- LOG(WARNING) << fmt::format("unsupported input type {} for aggregate
function {}",
- argument_types[0]->get_name(), name);
- return nullptr;
+ using creator = creator_with_type_list<TYPE_TINYINT, TYPE_SMALLINT,
TYPE_INT, TYPE_BIGINT,
+ TYPE_LARGEINT, TYPE_FLOAT,
TYPE_DOUBLE, TYPE_DECIMAL32,
+ TYPE_DECIMAL64, TYPE_DECIMAL128I,
TYPE_DECIMAL256>;
+ bool has_offset = (argument_types.size() == 3);
+ if (has_offset) {
+ return creator::create<HistogramWithInputParam,
AggregateFunctionLinearHistogramData>(
+ argument_types, result_is_nullable, attr);
+ } else {
+ return creator::create<HistogramNormal,
AggregateFunctionLinearHistogramData>(
+ argument_types, result_is_nullable, attr);
}
}
diff --git a/be/src/vec/aggregate_functions/aggregate_function_skew.cpp
b/be/src/vec/aggregate_functions/aggregate_function_skew.cpp
index 4e66e21a56d..8881b8ab640 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_skew.cpp
+++ b/be/src/vec/aggregate_functions/aggregate_function_skew.cpp
@@ -18,18 +18,25 @@
#include "vec/aggregate_functions/aggregate_function.h"
#include "vec/aggregate_functions/aggregate_function_simple_factory.h"
#include "vec/aggregate_functions/aggregate_function_statistic.h"
+#include "vec/aggregate_functions/factory_helpers.h"
#include "vec/aggregate_functions/helpers.h"
#include "vec/data_types/data_type.h"
namespace doris::vectorized {
#include "common/compile_check_begin.h"
-template <PrimitiveType T>
-AggregateFunctionPtr type_dispatch_for_aggregate_function_skew(const
DataTypes& argument_types,
- const bool
result_is_nullable,
- const
AggregateFunctionAttr& attr,
- bool
nullable_input) {
- using StatFunctionTemplate = StatFuncOneArg<T, 3>;
+AggregateFunctionPtr create_aggregate_function_skew(const std::string& name,
+ const DataTypes&
argument_types,
+ const bool
result_is_nullable,
+ const
AggregateFunctionAttr& attr) {
+ assert_arity_range(name, argument_types, 1, 1);
+ if (!result_is_nullable) {
+ throw doris::Exception(ErrorCode::INTERNAL_ERROR,
+ "Aggregate function {} requires
result_is_nullable", name);
+ }
+
+ const bool nullable_input = argument_types[0]->is_nullable();
+ using StatFunctionTemplate = StatFuncOneArg<TYPE_DOUBLE, 3>;
if (nullable_input) {
return creator_without_type::create_ignore_nullable<
@@ -40,53 +47,6 @@ AggregateFunctionPtr
type_dispatch_for_aggregate_function_skew(const DataTypes&
AggregateFunctionVarianceSimple<StatFunctionTemplate, false>>(
argument_types, result_is_nullable, attr,
STATISTICS_FUNCTION_KIND::SKEW_POP);
}
-};
-
-AggregateFunctionPtr create_aggregate_function_skew(const std::string& name,
- const DataTypes&
argument_types,
- const bool
result_is_nullable,
- const
AggregateFunctionAttr& attr) {
- if (argument_types.size() != 1) {
- LOG(WARNING) << "aggregate function " << name << " requires exactly 1
argument";
- return nullptr;
- }
-
- if (!result_is_nullable) {
- LOG(WARNING) << "aggregate function " << name << " requires nullable
result type";
- return nullptr;
- }
-
- const bool nullable_input = argument_types[0]->is_nullable();
- switch (argument_types[0]->get_primitive_type()) {
- case PrimitiveType::TYPE_BOOLEAN:
- return type_dispatch_for_aggregate_function_skew<TYPE_BOOLEAN>(
- argument_types, result_is_nullable, attr, nullable_input);
- case PrimitiveType::TYPE_TINYINT:
- return type_dispatch_for_aggregate_function_skew<TYPE_TINYINT>(
- argument_types, result_is_nullable, attr, nullable_input);
- case PrimitiveType::TYPE_SMALLINT:
- return type_dispatch_for_aggregate_function_skew<TYPE_SMALLINT>(
- argument_types, result_is_nullable, attr, nullable_input);
- case PrimitiveType::TYPE_INT:
- return type_dispatch_for_aggregate_function_skew<TYPE_INT>(
- argument_types, result_is_nullable, attr, nullable_input);
- case PrimitiveType::TYPE_BIGINT:
- return type_dispatch_for_aggregate_function_skew<TYPE_BIGINT>(
- argument_types, result_is_nullable, attr, nullable_input);
- case PrimitiveType::TYPE_LARGEINT:
- return type_dispatch_for_aggregate_function_skew<TYPE_LARGEINT>(
- argument_types, result_is_nullable, attr, nullable_input);
- case PrimitiveType::TYPE_FLOAT:
- return type_dispatch_for_aggregate_function_skew<TYPE_FLOAT>(
- argument_types, result_is_nullable, attr, nullable_input);
- case PrimitiveType::TYPE_DOUBLE:
- return type_dispatch_for_aggregate_function_skew<TYPE_DOUBLE>(
- argument_types, result_is_nullable, attr, nullable_input);
- default:
- LOG(WARNING) << "unsupported input type " <<
argument_types[0]->get_name()
- << " for aggregate function " << name;
- return nullptr;
- }
}
void register_aggregate_function_skewness(AggregateFunctionSimpleFactory&
factory) {
diff --git a/be/test/vec/aggregate_functions/agg_histogram_test.cpp
b/be/test/vec/aggregate_functions/agg_histogram_test.cpp
index 0cf091f7952..1d8dffcef2b 100644
--- a/be/test/vec/aggregate_functions/agg_histogram_test.cpp
+++ b/be/test/vec/aggregate_functions/agg_histogram_test.cpp
@@ -214,10 +214,7 @@ TEST_F(VAggHistogramTest, test_empty) {
test_agg_histogram<DataTypeFloat32>();
test_agg_histogram<DataTypeFloat64>();
- test_agg_histogram<DataTypeDate>();
- test_agg_histogram<DataTypeDateTime>();
test_agg_histogram<DataTypeString>();
- test_agg_histogram<DataTypeDecimalV2>();
}
TEST_F(VAggHistogramTest, test_with_data) {
@@ -231,13 +228,9 @@ TEST_F(VAggHistogramTest, test_with_data) {
test_agg_histogram<DataTypeFloat32>(100, 5);
test_agg_histogram<DataTypeFloat64>(100, 5);
- test_agg_histogram<DataTypeDate>(100, 5);
test_agg_histogram<DataTypeDateV2>(100, 5);
- test_agg_histogram<DataTypeDateTime>(100, 5);
test_agg_histogram<DataTypeDateTimeV2>(100, 5);
-
- test_agg_histogram<DataTypeDecimalV2>(100, 5);
}
} // namespace doris::vectorized
diff --git a/be/test/vec/aggregate_functions/agg_linear_histogram_test.cpp
b/be/test/vec/aggregate_functions/agg_linear_histogram_test.cpp
index 2111e55b8ba..bde2669ac68 100644
--- a/be/test/vec/aggregate_functions/agg_linear_histogram_test.cpp
+++ b/be/test/vec/aggregate_functions/agg_linear_histogram_test.cpp
@@ -301,7 +301,6 @@ TEST_F(AggLinearHistogramTest, test_empty) {
test_agg_linear_histogram<DataTypeDecimal32>(0, 0.5, 0);
test_agg_linear_histogram<DataTypeDecimal64>(0, 0.5, 0);
- test_agg_linear_histogram<DataTypeDecimalV2>(0, 0.5, 0);
test_agg_linear_histogram<DataTypeDecimal128>(0, 0.5, 0);
test_agg_linear_histogram<DataTypeDecimal256>(0, 0.5, 0);
}
@@ -318,7 +317,6 @@ TEST_F(AggLinearHistogramTest, test_with_data) {
test_agg_linear_histogram<DataTypeDecimal32>(5, 0.5, 0);
test_agg_linear_histogram<DataTypeDecimal64>(5, 0.5, 0);
- test_agg_linear_histogram<DataTypeDecimalV2>(5, 0.5, 0);
test_agg_linear_histogram<DataTypeDecimal128>(5, 0.5, 0);
test_agg_linear_histogram<DataTypeDecimal256>(5, 0.5, 0);
@@ -333,7 +331,6 @@ TEST_F(AggLinearHistogramTest, test_with_data) {
test_agg_linear_histogram<DataTypeDecimal32>(5, 0.5, 0.25);
test_agg_linear_histogram<DataTypeDecimal64>(5, 0.5, 0.25);
- test_agg_linear_histogram<DataTypeDecimalV2>(5, 0.5, 0.25);
test_agg_linear_histogram<DataTypeDecimal128>(5, 0.5, 0.25);
test_agg_linear_histogram<DataTypeDecimal256>(5, 0.5, 0.25);
}
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Kurt.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Kurt.java
index 4edf318e476..d48cf37089c 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Kurt.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Kurt.java
@@ -23,12 +23,7 @@ import
org.apache.doris.nereids.trees.expressions.functions.AlwaysNullable;
import
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
import org.apache.doris.nereids.trees.expressions.shape.UnaryExpression;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.BigIntType;
import org.apache.doris.nereids.types.DoubleType;
-import org.apache.doris.nereids.types.FloatType;
-import org.apache.doris.nereids.types.IntegerType;
-import org.apache.doris.nereids.types.SmallIntType;
-import org.apache.doris.nereids.types.TinyIntType;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
@@ -42,12 +37,7 @@ public class Kurt extends AggregateFunction
implements UnaryExpression, ExplicitlyCastableSignature,
AlwaysNullable {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
-
FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE),
-
FunctionSignature.ret(DoubleType.INSTANCE).args(BigIntType.INSTANCE),
-
FunctionSignature.ret(DoubleType.INSTANCE).args(IntegerType.INSTANCE),
-
FunctionSignature.ret(DoubleType.INSTANCE).args(SmallIntType.INSTANCE),
-
FunctionSignature.ret(DoubleType.INSTANCE).args(TinyIntType.INSTANCE),
- FunctionSignature.ret(DoubleType.INSTANCE).args(FloatType.INSTANCE)
+
FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE)
);
public Kurt(Expression arg1) {
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Skew.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Skew.java
index 4ea2e786b85..aa46bcecc12 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Skew.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Skew.java
@@ -23,12 +23,7 @@ import
org.apache.doris.nereids.trees.expressions.functions.AlwaysNullable;
import
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
import org.apache.doris.nereids.trees.expressions.shape.UnaryExpression;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.BigIntType;
import org.apache.doris.nereids.types.DoubleType;
-import org.apache.doris.nereids.types.FloatType;
-import org.apache.doris.nereids.types.IntegerType;
-import org.apache.doris.nereids.types.SmallIntType;
-import org.apache.doris.nereids.types.TinyIntType;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
@@ -43,12 +38,7 @@ public class Skew extends AggregateFunction
implements UnaryExpression, ExplicitlyCastableSignature,
AlwaysNullable {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
-
FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE),
-
FunctionSignature.ret(DoubleType.INSTANCE).args(BigIntType.INSTANCE),
-
FunctionSignature.ret(DoubleType.INSTANCE).args(IntegerType.INSTANCE),
-
FunctionSignature.ret(DoubleType.INSTANCE).args(SmallIntType.INSTANCE),
-
FunctionSignature.ret(DoubleType.INSTANCE).args(TinyIntType.INSTANCE),
- FunctionSignature.ret(DoubleType.INSTANCE).args(FloatType.INSTANCE)
+
FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE)
);
public Skew(Expression arg1) {
diff --git
a/regression-test/data/query_p0/sql_functions/aggregate_functions/test_aggregate_histogram.out
b/regression-test/data/query_p0/sql_functions/aggregate_functions/test_aggregate_histogram.out
index 0732300a97b..124e43be05b 100644
Binary files
a/regression-test/data/query_p0/sql_functions/aggregate_functions/test_aggregate_histogram.out
and
b/regression-test/data/query_p0/sql_functions/aggregate_functions/test_aggregate_histogram.out
differ
diff --git a/regression-test/suites/nereids_function_p0/agg_function/agg.groovy
b/regression-test/suites/nereids_function_p0/agg_function/agg.groovy
index b3dace65e72..727cedc322f 100644
--- a/regression-test/suites/nereids_function_p0/agg_function/agg.groovy
+++ b/regression-test/suites/nereids_function_p0/agg_function/agg.groovy
@@ -1095,33 +1095,6 @@ suite("nereids_agg_fn") {
// qt_sql_group_concat_Varchar_Varchar_AnyData_agg_phase_1_notnull '''
// select count(id), group_concat(distinct cast(abs(kint) as
varchar), '_x_' order by abs(ksint), kdt) from fn_test_not_nullable group by id
order by id'''
- sql '''
- select histogram(kbool) from fn_test group by kbool order by
kbool'''
- sql '''
- select histogram(kbool) from fn_test'''
- sql '''
- select histogram(kbool, 10) from fn_test'''
- sql '''
- select count(id), histogram(kbool) from fn_test group by id
order by id'''
- sql '''
- select count(distinct id), histogram(kbool) from fn_test'''
- sql '''
- select
/*+SET_VAR(disable_nereids_rules='THREE_PHASE_AGGREGATE_WITH_DISTINCT,
TWO_PHASE_AGGREGATE_WITH_DISTINCT')*/ count(distinct id, kint),
histogram(kbool) from fn_test group by kbool order by kbool'''
- sql '''
- select
/*+SET_VAR(disable_nereids_rules='THREE_PHASE_AGGREGATE_WITH_DISTINCT,
TWO_PHASE_AGGREGATE_WITH_DISTINCT')*/ count(distinct id), histogram(kbool) from
fn_test'''
- sql '''
- select histogram(kbool) from fn_test_not_nullable group by
kbool order by kbool'''
- sql '''
- select histogram(kbool) from fn_test_not_nullable'''
- sql '''
- select count(id), histogram(kbool) from fn_test_not_nullable
group by id order by id'''
- sql '''
- select count(distinct id), histogram(kbool) from
fn_test_not_nullable'''
- sql '''
- select
/*+SET_VAR(disable_nereids_rules='THREE_PHASE_AGGREGATE_WITH_DISTINCT,
TWO_PHASE_AGGREGATE_WITH_DISTINCT')*/ count(distinct id, kint),
histogram(kbool) from fn_test group by kbool order by kbool'''
- sql '''
- select
/*+SET_VAR(disable_nereids_rules='THREE_PHASE_AGGREGATE_WITH_DISTINCT,
TWO_PHASE_AGGREGATE_WITH_DISTINCT')*/ count(distinct id), histogram(kbool) from
fn_test'''
-
sql '''
select histogram(ktint) from fn_test group by kbool order by
kbool'''
sql '''
diff --git
a/regression-test/suites/nereids_p0/sql_functions/aggregate_functions/test_aggregate_histogram.groovy
b/regression-test/suites/nereids_p0/sql_functions/aggregate_functions/test_aggregate_histogram.groovy
index 1604f38d72f..e27a90330a9 100644
---
a/regression-test/suites/nereids_p0/sql_functions/aggregate_functions/test_aggregate_histogram.groovy
+++
b/regression-test/suites/nereids_p0/sql_functions/aggregate_functions/test_aggregate_histogram.groovy
@@ -108,7 +108,6 @@
// // If it does, need to add a similar method histogramhist(c_decimalv3,
2).
// qt_select """
// SELECT
-// histogram(c_bool, 2),
// histogram(c_tinyint, 2),
// histogram(c_smallint, 2),
// histogram(c_bigint, 2),
diff --git
a/regression-test/suites/query_p0/sql_functions/aggregate_functions/test_aggregate_histogram.groovy
b/regression-test/suites/query_p0/sql_functions/aggregate_functions/test_aggregate_histogram.groovy
index 6f12c29656d..dc3cba39171 100644
---
a/regression-test/suites/query_p0/sql_functions/aggregate_functions/test_aggregate_histogram.groovy
+++
b/regression-test/suites/query_p0/sql_functions/aggregate_functions/test_aggregate_histogram.groovy
@@ -103,7 +103,6 @@ suite("test_aggregate_histogram") {
// Test without GROUP BY
qt_select """
SELECT
- histogram(c_bool, 2),
histogram(c_tinyint, 2),
histogram(c_smallint, 2),
histogram(c_bigint, 2),
@@ -128,7 +127,6 @@ suite("test_aggregate_histogram") {
qt_select """
SELECT
c_id,
- hist(c_bool, 2),
hist(c_tinyint, 2),
hist(c_smallint, 2),
hist(c_bigint, 2),
@@ -157,7 +155,6 @@ suite("test_aggregate_histogram") {
CREATE TABLE ${tableCTAS1} PROPERTIES("replication_num" = "1") AS
SELECT
1,
- hist(c_bool, 2),
hist(c_tinyint, 2),
hist(c_smallint, 2),
hist(c_bigint, 2),
@@ -182,7 +179,6 @@ suite("test_aggregate_histogram") {
CREATE TABLE ${tableCTAS2} PROPERTIES("replication_num" = "1") AS
SELECT
1,
- hist(c_bool, 2),
hist(c_tinyint, 2),
hist(c_smallint, 2),
hist(c_bigint, 2),
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]