This is an automated email from the ASF dual-hosted git repository.

morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new bdcf9978abf [fix](array) fix build when using gcc (#52759)
bdcf9978abf is described below

commit bdcf9978abf843d0cf2eef11015d7b13bf4a820d
Author: Sun Chenyang <[email protected]>
AuthorDate: Mon Jul 7 16:20:11 2025 +0800

    [fix](array) fix build when using gcc (#52759)
    
    fix build when using gcc. introduced by #52640
---
 .../functions/array/function_array_aggregation.cpp | 47 ++++++++++------------
 1 file changed, 22 insertions(+), 25 deletions(-)

diff --git a/be/src/vec/functions/array/function_array_aggregation.cpp 
b/be/src/vec/functions/array/function_array_aggregation.cpp
index 6879d68144c..05db527a744 100644
--- a/be/src/vec/functions/array/function_array_aggregation.cpp
+++ b/be/src/vec/functions/array/function_array_aggregation.cpp
@@ -281,32 +281,29 @@ struct ArrayAggregateImpl {
     template <typename Element>
     static bool execute_type(ColumnPtr& res_ptr, const DataTypePtr& type, 
const IColumn* data,
                              const ColumnArray::Offsets64& offsets) {
-        using ColVecType = ColumnVectorOrDecimal<Element>;
-        using ResultType = ArrayAggregateResult<Element, operation, 
enable_decimal256>;
-        using ColVecResultType = ColumnVectorOrDecimal<ResultType>;
-
-        return execute_type_impl<ColVecType>(
-                res_ptr, type, data, offsets, [](const ColVecType* column) -> 
ColumnPtr {
-                    if constexpr (IsDecimalNumber<Element>) {
-                        return ColVecResultType::create(0, 
column->get_scale());
-                    } else {
-                        return ColVecResultType::create();
-                    }
-                });
-    }
-
-    template <>
-    static bool execute_type<String>(ColumnPtr& res_ptr, const DataTypePtr& 
type,
-                                     const IColumn* data, const 
ColumnArray::Offsets64& offsets) {
-        if (operation == AggregateOperation::SUM || operation == 
AggregateOperation::PRODUCT ||
-            operation == AggregateOperation::AVERAGE) {
-            return false;
+        if constexpr (std::is_same_v<Element, String>) {
+            if (operation == AggregateOperation::SUM || operation == 
AggregateOperation::PRODUCT ||
+                operation == AggregateOperation::AVERAGE) {
+                return false;
+            }
+            using ColumnType = ColumnString;
+            return execute_type_impl<ColumnType>(
+                    res_ptr, type, data, offsets,
+                    [](const ColumnType*) -> ColumnPtr { return 
ColumnString::create(); });
+        } else {
+            using ColVecType = ColumnVectorOrDecimal<Element>;
+            using ResultType = ArrayAggregateResult<Element, operation, 
enable_decimal256>;
+            using ColVecResultType = ColumnVectorOrDecimal<ResultType>;
+
+            return execute_type_impl<ColVecType>(
+                    res_ptr, type, data, offsets, [](const ColVecType* column) 
-> ColumnPtr {
+                        if constexpr (IsDecimalNumber<Element>) {
+                            return ColVecResultType::create(0, 
column->get_scale());
+                        } else {
+                            return ColVecResultType::create();
+                        }
+                    });
         }
-        using ColumnType = ColumnString;
-
-        return execute_type_impl<ColumnType>(
-                res_ptr, type, data, offsets,
-                [](const ColumnType*) -> ColumnPtr { return 
ColumnString::create(); });
     }
 };
 


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

Reply via email to