-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](inverted index) Fix NULL bitmap handling in MATCH OR queries #56699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
TPC-DS: Total hot run time: 188685 ms |
ClickBench: Total hot run time: 30.12 s |
|
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a critical bug in NULL bitmap handling for MATCH OR queries in the inverted index system. The bug was causing incorrect boolean logic evaluation when combining TRUE and NULL values in OR operations.
- Fixed the
InvertedIndexResultBitmap::operator|=()method to properly implement SQL three-valued logic for OR operations - Added comprehensive unit tests to verify correct NULL handling in various OR scenarios
- Added regression tests to ensure MATCH OR queries with NULL values return the correct results
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| be/src/olap/rowset/segment_v2/inverted_index_reader.h | Core fix for NULL bitmap handling in OR operations using proper three-valued logic |
| be/test/olap/rowset/segment_v2/inverted_index_reader_test.cpp | Unit tests covering all cases of OR operations with NULL values |
| regression-test/suites/inverted_index_p0/test_match_or_null_semantics.groovy | Integration tests verifying MATCH OR queries work correctly with NULL values |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| WHERE title MATCH_ALL 'Philosophy' OR content MATCH_ALL 'Disney+ Hotstar' | ||
| """ | ||
|
|
||
| assertEquals(16, test1[0][0], "MATCH should return 16 rows (15 with title match + 1 with content match)") |
Copilot
AI
Oct 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed typo in error message: 'recieve' should be 'receive'.
| for (uint32_t i = 0; i < 15; ++i) { | ||
| EXPECT_TRUE(bitmap_field1.get_data_bitmap()->contains(i)) | ||
| << "Row " << i << " should be TRUE"; | ||
| EXPECT_FALSE(bitmap_field1.get_null_bitmap()->contains(i)) | ||
| << "Row " << i << " should not be NULL"; | ||
| } |
Copilot
AI
Oct 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The magic number 15 is used without explanation. Consider extracting it to a named constant like NUM_MATCHING_ROWS or adding a comment explaining why 15 rows are expected.
ClickBench: Total hot run time: 30.06 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
eldenmoon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
zhiqiang-hhhh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
…pache#56699) Related PR: apache#56139 Problem Summary: This PR fixes a bug in NULL bitmap handling for MATCH OR queries in inverted index query. The bug was causing incorrect boolean logic evaluation when combining TRUE and NULL values in OR operations.
…pache#56699) Related PR: apache#56139 Problem Summary: This PR fixes a bug in NULL bitmap handling for MATCH OR queries in inverted index query. The bug was causing incorrect boolean logic evaluation when combining TRUE and NULL values in OR operations.
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #56139
Problem Summary:
This PR fixes a bug in NULL bitmap handling for MATCH OR queries in inverted index query. The bug was causing incorrect boolean logic evaluation when combining TRUE and NULL values in OR operations.
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)