Skip to content
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

branch-3.0: [fix](delete) Fix static type dispatch by mistake due to typo #43022

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions be/src/olap/delete_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,17 +346,22 @@ Status DeleteHandler::parse_condition(const std::string& condition_str, TConditi
}

template <typename SubPredType>
requires(std::is_same_v<SubPredType, DeleteSubPredicatePB> or
std::is_same_v<SubPredType, std::string>)
Status DeleteHandler::_parse_column_pred(TabletSchemaSPtr complete_schema,
TabletSchemaSPtr delete_pred_related_schema,
const RepeatedPtrField<SubPredType>& sub_pred_list,
DeleteConditions* delete_conditions) {
for (const auto& sub_predicate : sub_pred_list) {
TCondition condition;
RETURN_IF_ERROR(parse_condition(sub_predicate, &condition));
int32_t col_unique_id;
if constexpr (std::is_same_v<SubPredType, DeletePredicatePB>) {
col_unique_id = sub_predicate.col_unique_id;
} else {
int32_t col_unique_id = -1;
if constexpr (std::is_same_v<SubPredType, DeleteSubPredicatePB>) {
if (sub_predicate.has_column_unique_id()) [[likely]] {
col_unique_id = sub_predicate.column_unique_id();
}
}
if (col_unique_id < 0) {
const auto& column =
*DORIS_TRY(delete_pred_related_schema->column(condition.column_name));
col_unique_id = column.unique_id();
Expand Down
3 changes: 3 additions & 0 deletions be/src/olap/delete_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include <cstdint>
#include <string>
#include <type_traits>

#include "common/factory_creator.h"
#include "common/status.h"
Expand Down Expand Up @@ -115,6 +116,8 @@ class DeleteHandler {

private:
template <typename SubPredType>
requires(std::is_same_v<SubPredType, DeleteSubPredicatePB> or
std::is_same_v<SubPredType, std::string>)
Status _parse_column_pred(
TabletSchemaSPtr complete_schema, TabletSchemaSPtr delete_pred_related_schema,
const ::google::protobuf::RepeatedPtrField<SubPredType>& sub_pred_list,
Expand Down
Loading