csun5285 commented on code in PR #68632:
URL: https://github.com/apache/doris/pull/68632#discussion_r4131781806


##########
be/src/exprs/function/array/function_array_aggregation.cpp:
##########
@@ -90,7 +90,8 @@ struct AggregateFunctionTraits<AggregateOperation::AVERAGE> {
     struct TypeTraits {
         static constexpr PrimitiveType ResultType =
                 Element == TYPE_DECIMALV2 ? TYPE_DECIMALV2 : TYPE_DOUBLE;
-        using AggregateDataType = AggregateFunctionAvgData<ResultType>;
+        // Add up the values in the same type as avg(). A double sum loses 
digits of large integers.
+        using AggregateDataType = 
AggregateFunctionAvgData<avg_sum_type(Element)>;

Review Comment:
   array_avg 和 avg() 保持一致



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to