Skip to content

Commit 4244287

Browse files
TangSiyang2001dataroaring
authored andcommitted
[fix](delete) Only apply regex check on delete condition str for non-lsc tables (#39357)
## Proposed changes Light schema change capable tables will work on delete sub predicate v2 and doesn't need this check.
1 parent f6a4ba9 commit 4244287

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

be/src/olap/delete_handler.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,20 @@ Status DeleteHandler::generate_delete_predicate(const TabletSchema& schema,
124124
} else {
125125
// write sub predicate v1 for compactbility
126126
std::string condition_str = construct_sub_predicate(condition);
127-
if (TCondition tmp; !DeleteHandler::parse_condition(condition_str, &tmp)) {
128-
LOG(WARNING) << "failed to parse condition_str, condtion="
129-
<< ThriftDebugString(condition);
130-
return Status::Error<ErrorCode::INVALID_ARGUMENT>(
131-
"failed to parse condition_str, condtion={}", ThriftDebugString(condition));
132-
}
133127
VLOG_NOTICE << __PRETTY_FUNCTION__ << " condition_str: " << condition_str;
134128
del_pred->add_sub_predicates(condition_str);
135129
DeleteSubPredicatePB* sub_predicate = del_pred->add_sub_predicates_v2();
136130
if (condition.__isset.column_unique_id) {
131+
// only light schema change capable table set this field
137132
sub_predicate->set_column_unique_id(condition.column_unique_id);
133+
} else if (TCondition tmp; !DeleteHandler::parse_condition(condition_str, &tmp)) {
134+
// for non light shema change tables, check regex match for condition str
135+
LOG(WARNING) << "failed to parse condition_str, condtion="
136+
<< ThriftDebugString(condition);
137+
return Status::Error<ErrorCode::INVALID_ARGUMENT>(
138+
"failed to parse condition_str, condtion={}", ThriftDebugString(condition));
138139
}
140+
139141
sub_predicate->set_column_name(condition.column_name);
140142
sub_predicate->set_op(trans_op(condition.condition_op));
141143
sub_predicate->set_cond_value(condition.condition_values[0]);

0 commit comments

Comments
 (0)