-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[Bug](predicate) fix wrong result of AcceptNullPredicate #39497
Conversation
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
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.
PLEASE ADD TEST
@@ -158,21 +156,26 @@ class AcceptNullPredicate : public ColumnPredicate { | |||
} | |||
// create selected_flags | |||
uint16_t max_idx = sel[size - 1]; | |||
std::vector<uint16_t> old_sel(size); |
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.
please add some test
// add rows selected by _nested->evaluate | ||
for (uint16_t i = 0; i < new_size; ++i) { | ||
uint16_t row_idx = sel[i]; | ||
selected[row_idx] = true; | ||
} | ||
for (uint16_t i = 0; i < size; ++i) { |
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.
add comment here
@@ -158,21 +156,26 @@ class AcceptNullPredicate : public ColumnPredicate { | |||
} | |||
// create selected_flags | |||
uint16_t max_idx = sel[size - 1]; | |||
std::vector<uint16_t> old_sel(size); | |||
memcpy(old_sel.data(), sel, sizeof(uint16_t) * size); | |||
|
|||
const auto& nullable_col = assert_cast<const vectorized::ColumnNullable&>(column); | |||
// call nested predicate evaluate | |||
uint16_t new_size = _nested->evaluate(nullable_col.get_nested_column(), sel, size); | |||
|
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.
sel 1,2,3,7,8,9
sel 1,2,3,4,5,6,7,8,9
run buildall |
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.
LGTM
const auto& nullable_col = assert_cast<const vectorized::ColumnNullable&>(column); | ||
_nested->evaluate_and(nullable_col.get_nested_column(), sel, size, flags); | ||
const auto& nullmap = nullable_col.get_null_map_data(); | ||
for (uint16_t i = 0; i < size; ++i) { | ||
flags[i] |= nullmap[sel[i]]; | ||
flags[i] |= (original_flags[i] && nullmap[sel[i]]); |
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.
我觉得这里不对吧
是不是应该是 flags[sel[i]] |= (original_flags[sel[i]] && nullmap[sel[i]]);
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
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.
LGTM
fix wrong result of AcceptNullPredicate
## Proposed changes fix wrong result of AcceptNullPredicate
Proposed changes
fix wrong result of AcceptNullPredicate