Skip to content

branch-3.1: [Bug](aggregate) fix bitmap_union return error result in query sql #52033 - #53000

Merged
morrySnow merged 1 commit into
apache:branch-3.1from
zhangstar333:branch-3.1-0709
Jul 10, 2025
Merged

branch-3.1: [Bug](aggregate) fix bitmap_union return error result in query sql #52033#53000
morrySnow merged 1 commit into
apache:branch-3.1from
zhangstar333:branch-3.1-0709

Conversation

@zhangstar333

@zhangstar333zhangstar333 commented Jul 9, 2025

Copy link
Copy Markdown
Contributor

cherry-pick from master #52033

…pache#52033)
Problem Summary:
the bitmap union maybe could call add_batch firstly, and the call add
function,
so if add_batch function not update is_first variable, it's will be loss
data in union.
```
static void add(BitmapValue& res, const BitmapValue& data, bool& is_first) {
if (UNLIKELY(is_first)) {
res = data;
is_first = false;
} else {
res |= data;
}
}
static void add_batch(BitmapValue& res, std::vector<const BitmapValue*>& data, bool& is_first) {
res.fastunion(data);
is_first = false; // before not set this
}
```
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@zhangstar333

Copy link
Copy Markdown
ContributorAuthor

run buildall

@doris-robot

Copy link
Copy Markdown

BE UT Coverage Report

Increment line coverage 0.00% (0/2) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage45.13% (12479/27650)
Line Coverage35.99% (110626/307410)
Region Coverage35.17% (57364/163100)
Branch Coverage32.24% (31096/96446)

@morrySnowmorrySnow changed the title [cherry-pick](branch-31) fix bitmap_union return error result in query sql (#52033)branch-3.1: [Bug](aggregate) fix bitmap_union return error result in query sql #52033Jul 9, 2025
@morrySnow
morrySnow merged commit 7db692f into apache:branch-3.1Jul 10, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@zhangstar333@hello-stephen@doris-robot@morrySnow