-
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
[Feature]support max_by/min_by in window op #54961
Conversation
Signed-off-by: before-Sunrise <[email protected]>
} | ||
} | ||
} | ||
|
||
std::string get_name() const override { return "maxmin_by"; } | ||
}; | ||
|
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 null pointer dereference.
You can modify the code like this:
void get_values(FunctionContext* ctx, ConstAggDataPtr __restrict state, Column* dst, size_t start,
size_t end) const override {
if (!dst) {
throw std::invalid_argument("Destination column is nullptr");
}
if constexpr (State::not_filter_nulls_flag) {
if (this->data(state).null_result) {
DCHECK(dst->is_nullable());
for (size_t i = start; i < end; ++i) {
dst->append_default();
}
} else {
if (dst->is_nullable()) {
for (size_t i = start; i < end; ++i) {
down_cast<NullableColumn*>(dst)->null_column()->append(DATUM_NOT_NULL);
}
}
for (size_t i = start; i < end; ++i) {
ColumnHelper::get_data_column(dst)->deserialize_and_append(this->data(state).buffer_result.data());
}
}
} else {
if (this->data(state).buffer_result.empty()) {
for (size_t i = start; i < end; ++i) {
dst->append_default();
}
} else {
if (dst->is_nullable()) {
for (size_t i = start; i < end; ++i) {
down_cast<NullableColumn*>(dst)->null_column()->append(DATUM_NOT_NULL);
}
}
for (size_t i = start; i < end; ++i) {
ColumnHelper::get_data_column(dst)->deserialize_and_append(this->data(state).buffer_result.data());
}
}
}
}
It seems a new feature, you should change this title from bug fix into feature |
@before-Sunrise |
Signed-off-by: before-Sunrise <[email protected]>
a1266be
to
4e80db0
Compare
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[BE Incremental Coverage Report]❌ fail : 20 / 36 (55.56%) file detail
|
@Mergifyio backport branch-3.4 |
@Mergifyio backport branch-3.3 |
✅ Backports have been created
|
✅ Backports have been created
|
Signed-off-by: before-Sunrise <[email protected]> (cherry picked from commit da2ef02)
Signed-off-by: before-Sunrise <[email protected]> (cherry picked from commit da2ef02)
Why I'm doing:
What I'm doing:
Fixes #55077
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: