diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Sum.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Sum.java index 87992039361095..f0dbd839583857 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Sum.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Sum.java @@ -114,7 +114,7 @@ public List getSignatures() { @Override public FunctionSignature searchSignature(List signatures) { if (getArgument(0).getDataType() instanceof FloatType) { - return FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE); + return FunctionSignature.ret(DoubleType.INSTANCE).args(FloatType.INSTANCE); } return ExplicitlyCastableSignature.super.searchSignature(signatures); } 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 1a12fd0383de5f..81c84ad32d8f7e 100644 --- a/regression-test/suites/nereids_function_p0/agg_function/agg.groovy +++ b/regression-test/suites/nereids_function_p0/agg_function/agg.groovy @@ -2188,6 +2188,12 @@ suite("nereids_agg_fn") { qt_sql_sum_BigInt_agg_phase_4_notnull ''' select /*+SET_VAR(disable_nereids_rules='THREE_PHASE_AGGREGATE_WITH_DISTINCT, TWO_PHASE_AGGREGATE_WITH_DISTINCT')*/ count(distinct id), sum(kbint) from fn_test''' + //not cast float to double + explain { + sql("select sum(kfloat) from fn_test;") + contains "partial_sum(kfloat" + } + qt_sql_sum_Double_gb ''' select sum(kdbl) from fn_test group by kbool order by kbool''' qt_sql_sum_Double '''