From 0ff2a9df15b9139ee75a3c4c2f19600d90dbd001 Mon Sep 17 00:00:00 2001 From: Siyang Tang <82279870+TangSiyang2001@users.noreply.github.com> Date: Sat, 17 Aug 2024 16:56:37 +0800 Subject: [PATCH] [fix](delete) Only apply regex check on delete condition str for non-lsc tables (#39357) (#39500) ## Proposed changes Light schema change capable tables will work on delete sub predicate v2 and doesn't need this check. --- be/src/olap/delete_handler.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/be/src/olap/delete_handler.cpp b/be/src/olap/delete_handler.cpp index 2ab3786b4d..2ac4aa1f42 100644 --- a/be/src/olap/delete_handler.cpp +++ b/be/src/olap/delete_handler.cpp @@ -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)) { + 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( "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) { - sub_predicate->set_column_unique_id(condition.column_unique_id); - } + 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]);