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 7db692f37fb branch-3.1: [Bug](aggregate) fix bitmap_union return error 
result in query sql #52033 (#53000)
7db692f37fb is described below

commit 7db692f37fbbd2f331d50d473040f3e87588136d
Author: zhangstar333 <[email protected]>
AuthorDate: Thu Jul 10 10:24:04 2025 +0800

    branch-3.1: [Bug](aggregate) fix bitmap_union return error result in query 
sql #52033 (#53000)
    
    cherry-pick from master #52033
---
 be/src/vec/aggregate_functions/aggregate_function_bitmap.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/be/src/vec/aggregate_functions/aggregate_function_bitmap.h 
b/be/src/vec/aggregate_functions/aggregate_function_bitmap.h
index b0619a63e1f..6784d78a1aa 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_bitmap.h
+++ b/be/src/vec/aggregate_functions/aggregate_function_bitmap.h
@@ -54,6 +54,7 @@ struct AggregateFunctionBitmapUnionOp {
     template <typename T>
     static void add(BitmapValue& res, const T& data, bool& is_first) {
         res.add(data);
+        is_first = false;
     }
 
     static void add(BitmapValue& res, const BitmapValue& data, bool& is_first) 
{
@@ -67,6 +68,9 @@ struct AggregateFunctionBitmapUnionOp {
 
     static void add_batch(BitmapValue& res, std::vector<const BitmapValue*>& 
data, bool& is_first) {
         res.fastunion(data);
+        // after fastunion, res myabe have many datas, so is_first should be 
false
+        // then call add function will not reset res
+        is_first = false;
     }
 
     static void merge(BitmapValue& res, const BitmapValue& data, bool& 
is_first) {


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

Reply via email to