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

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


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new c75f42ac26f  [Bug](function) fix wrong result about array_agg_foreach 
#55075  (#55412)
c75f42ac26f is described below

commit c75f42ac26ffe9a99ae8c3bc365c3c97108bec41
Author: Pxl <[email protected]>
AuthorDate: Sat Aug 30 15:39:25 2025 +0800

     [Bug](function) fix wrong result about array_agg_foreach #55075  (#55412)
    
    pick from #55075
---
 .../aggregate_functions/aggregate_function_collect.h | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/be/src/vec/aggregate_functions/aggregate_function_collect.h 
b/be/src/vec/aggregate_functions/aggregate_function_collect.h
index ccb327226ee..5c4988eca23 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_collect.h
+++ b/be/src/vec/aggregate_functions/aggregate_function_collect.h
@@ -399,15 +399,7 @@ struct AggregateFunctionArrayAggData {
     }
 
     void merge(const Self& rhs) {
-        const auto size = rhs.null_map->size();
-        null_map->resize(size);
-        nested_column->reserve(size);
-        for (size_t i = 0; i < size; i++) {
-            const auto null_value = rhs.null_map->data()[i];
-            const auto data_value = rhs.nested_column->get_data()[i];
-            null_map->data()[i] = null_value;
-            nested_column->get_data().push_back(data_value);
-        }
+        column_data->insert_range_from(*rhs.column_data, 0, 
rhs.column_data->size());
     }
 };
 
@@ -495,15 +487,7 @@ struct AggregateFunctionArrayAggData<StringRef> {
     }
 
     void merge(const Self& rhs) {
-        const auto size = rhs.null_map->size();
-        null_map->resize(size);
-        nested_column->reserve(size);
-        for (size_t i = 0; i < size; i++) {
-            const auto null_value = rhs.null_map->data()[i];
-            auto s = rhs.nested_column->get_data_at(i);
-            null_map->data()[i] = null_value;
-            nested_column->insert_data(s.data, s.size);
-        }
+        column_data->insert_range_from(*rhs.column_data, 0, 
rhs.column_data->size());
     }
 };
 


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

Reply via email to