-
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
[BugFix] Fix window cumulative algorithm for max/min with string type #55537
Conversation
Signed-off-by: before-Sunrise <unclejyj@gmail.com>
update(ctx, columns, state, current_frame_last_position); | ||
} | ||
} | ||
|
||
void merge(FunctionContext* ctx, const Column* column, AggDataPtr __restrict state, size_t row_num) const override { | ||
DCHECK(column->is_binary()); | ||
Slice value = column->get(row_num).get_slice(); |
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 out-of-bounds access when accessing null_column->raw_data()
if the null column isn't actually available or properly casted.
You can modify the code like this:
if (has_null && columns[1]->is_nullable()) {
const auto null_column = down_cast<const NullColumn*>(columns[1]);
const uint8_t* f_data = null_column->raw_data();
for (size_t i = frame_start; i < frame_end; ++i) {
if (f_data[i] == 0) {
update(ctx, columns, state, i);
}
}
} else if (!has_null) {
update_batch_single_state_with_frame(ctx, state, columns, partition_start, partition_end,
frame_start, frame_end);
}
Signed-off-by: before-Sunrise <unclejyj@gmail.com>
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[BE Incremental Coverage Report]✅ pass : 20 / 22 (90.91%) file detail
|
@Mergifyio backport branch-3.4 |
@Mergifyio backport branch-3.3 |
✅ Backports have been created
|
✅ Backports have been created
|
Why I'm doing:'
Fixes #55532
#54849 support cumulative algorithm for max/min, but forgot to support string type, which is a Specialized template class
we can change be config: pipeline_analytic_enable_removable_cumulative_process to false to bypass this issue temporarily
What I'm doing:
support string type
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: