-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Enhancement] Open or close interval need to be considered when using runtime filter to process zonemap. #54687
Conversation
… process Zonemap. Signed-off-by: trueeyu <[email protected]>
if (*min_value > _max) return true; | ||
} else { | ||
if (*min_value >= _max) return true; | ||
} | ||
return false; | ||
} | ||
|
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 most risky bug in this code is:
Potential dereference of null pointer(s) min_value
or max_value
.
You can modify the code like this:
bool filter_zonemap_with_min_max(const CppType* min_value, const CppType* max_value) const {
if (min_value == nullptr || max_value == nullptr) return false;
if (_left_close_interval) {
if (*max_value < _min) return true;
} else {
if (*max_value <= _min) return true;
}
if (_right_close_interval) {
if (*min_value > _max) return true;
} else {
if (*min_value >= _max) return true;
}
return false;
}
Note: The modification ensures appropriate handling of null pointers. However, given that there are checks verifying null values at the start of the function, it seems more likely to be a matter of logical assurance than an actual programming oversight. If there's any part of the calling context not shared here that doesn't safeguard against this issue, you should add or maintain proper null checks before dereferencing these pointers elsewhere, confirming the provided conditional logic is robust.
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.
I already add the dereference of null pointers
Signed-off-by: trueeyu <[email protected]>
need add a benchmark case |
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[BE Incremental Coverage Report]❌ fail : 4 / 6 (66.67%) file detail
|
Why I'm doing:
When the column using topn runtime filter is low cardinality, the filtering effect is sometimes not very good, so we need to consider the open/close interval.
What I'm doing:
Open or close interval need to be considered when using runtimeFilter to process zonemap.
Before the pr: 3.02s
After the pr: 0.69s
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: