Skip to content

Commit

Permalink
[fix] Only apply regex check on delete condition str for non-lsc tables
Browse files Browse the repository at this point in the history
  • Loading branch information
TangSiyang2001 committed Aug 14, 2024
1 parent 1f87ecf commit 566483b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions be/src/olap/delete_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,20 @@ Status DeleteHandler::generate_delete_predicate(const TabletSchema& schema,
} else {
// write sub predicate v1 for compactbility
std::string condition_str = construct_sub_predicate(condition);
if (TCondition tmp; !DeleteHandler::parse_condition(condition_str, &tmp)) {
LOG(WARNING) << "failed to parse condition_str, condtion="
<< ThriftDebugString(condition);
return Status::Error<ErrorCode::INVALID_ARGUMENT>(
"failed to parse condition_str, condtion={}", ThriftDebugString(condition));
}
VLOG_NOTICE << __PRETTY_FUNCTION__ << " condition_str: " << condition_str;
del_pred->add_sub_predicates(condition_str);
DeleteSubPredicatePB* sub_predicate = del_pred->add_sub_predicates_v2();
if (condition.__isset.column_unique_id) {
// only light schema change capable table set this field
sub_predicate->set_column_unique_id(condition.column_unique_id);
} else if (TCondition tmp; !DeleteHandler::parse_condition(condition_str, &tmp)) {
// for non light shema change tables, check regex match for condition str
LOG(WARNING) << "failed to parse condition_str, condtion="
<< ThriftDebugString(condition);
return Status::Error<ErrorCode::INVALID_ARGUMENT>(
"failed to parse condition_str, condtion={}", ThriftDebugString(condition));
}

sub_predicate->set_column_name(condition.column_name);
sub_predicate->set_op(trans_op(condition.condition_op));
sub_predicate->set_cond_value(condition.condition_values[0]);
Expand Down

0 comments on commit 566483b

Please sign in to comment.