[FEAT MERGE]4_1_sql_feature

Co-authored-by: leslieyuchen <leslieyuchen@gmail.com>
Co-authored-by: Charles0429 <xiezhenjiang@gmail.com>
Co-authored-by: raywill <hustos@gmail.com>
This commit is contained in:
obdev
2023-01-28 16:01:26 +08:00
committed by ob-robot
parent 3080f2b66f
commit 2d19a9d8f5
846 changed files with 161957 additions and 116661 deletions

View File

@ -38,6 +38,7 @@ int ObMergeLogPlan::generate_raw_plan()
} else {
const ObMergeStmt *merge_stmt = get_stmt();
LOG_TRACE("start to allocate operators for ", "sql", get_optimizer_context().get_query_ctx()->get_sql_stmt());
OPT_TRACE("generate plan for ", get_stmt());
if (OB_FAIL(generate_plan_tree())) {
LOG_WARN("failed to generate plan tree for plain select", K(ret));
} else {
@ -157,6 +158,9 @@ int ObMergeLogPlan::candi_allocate_merge()
ObSEArray<CandidatePlan, 8> merge_plans;
const bool force_no_multi_part = get_log_plan_hint().no_use_distributed_dml();
const bool force_multi_part = get_log_plan_hint().use_distributed_dml();
OPT_TRACE("start generate normal merge plan");
OPT_TRACE("force no multi part:", force_no_multi_part);
OPT_TRACE("force multi part:", force_multi_part);
if (OB_FAIL(calculate_insert_table_location_and_sharding(insert_table_part,
insert_sharding))) {
LOG_WARN("failed to calculate insert table location and sharding", K(ret));
@ -234,6 +238,7 @@ int ObMergeLogPlan::candi_allocate_pdml_merge()
ObTablePartitionInfo *target_table_partition = NULL;
ObSEArray<CandidatePlan, 8> best_plans;
const IndexDMLInfo *index_dml_info = NULL;
OPT_TRACE("start generate pdml merge plan");
if (get_stmt()->has_insert_clause()) {
if (index_dml_infos_.empty() || OB_ISNULL(index_dml_info = index_dml_infos_.at(0))) {
ret = OB_ERR_UNEXPECTED;
@ -831,7 +836,8 @@ int ObMergeLogPlan::prepare_table_dml_info_update(const ObMergeTableInfo& merge_
table_dml_info->ck_cst_exprs_.at(i),
table_dml_info->ck_cst_exprs_.at(i)))) {
LOG_WARN("failed to copy on replace expr", K(ret));
} else if (OB_FAIL(ObTableAssignment::expand_expr(merge_info.assignments_,
} else if (OB_FAIL(ObTableAssignment::expand_expr(optimizer_context_.get_expr_factory(),
merge_info.assignments_,
table_dml_info->ck_cst_exprs_.at(i)))) {
LOG_WARN("failed to expand expr", K(ret));
}