fix granule iterator generate T_PDML_PARTITION_ID expr bug
This commit is contained in:
parent
3b31ff02ed
commit
4f890f0a8c
@ -695,7 +695,6 @@ int ObGranuleIteratorOp::do_join_filter_partition_pruning(
|
||||
|
||||
if (OB_SUCC(ret) && OB_NOT_NULL(rf_msg_) && rf_msg_->check_ready()) {
|
||||
uint64_t hash_val = ObExprJoinFilter::JOIN_FILTER_SEED;
|
||||
ObDatum &datum = MY_SPEC.tablet_id_expr_->locate_expr_datum(eval_ctx_);
|
||||
if (MY_SPEC.bf_info_.skip_subpart_) {
|
||||
int64_t part_id = OB_INVALID_ID;
|
||||
if (OB_FAIL(try_build_tablet2part_id_map())) {
|
||||
@ -707,6 +706,7 @@ int ObGranuleIteratorOp::do_join_filter_partition_pruning(
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret) && !is_match) {
|
||||
ObDatum datum;
|
||||
datum.int_ = &tablet_id;
|
||||
datum.len_ = sizeof(tablet_id);
|
||||
ObRFBloomFilterMsg *bf_msg = static_cast<ObRFBloomFilterMsg *>(rf_msg_);
|
||||
|
@ -127,6 +127,7 @@ public:
|
||||
// for partition join filter
|
||||
ObPxBFStaticInfo bf_info_;
|
||||
ObHashFunc hash_func_;
|
||||
//TODO: shanting. remove this expr in 4.3
|
||||
ObExpr *tablet_id_expr_;
|
||||
// end for partition join filter
|
||||
int64_t repart_pruning_tsc_idx_;
|
||||
|
@ -953,7 +953,11 @@ int ObTableScanOp::update_output_tablet_id()
|
||||
} else {
|
||||
data_tablet_loc = scan_result_.get_tablet_loc();
|
||||
}
|
||||
if (OB_NOT_NULL(data_tablet_loc)) {
|
||||
if (OB_ISNULL(data_tablet_loc)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("data tablet loc is null, value of pdml partition id will not be set", K(ret),
|
||||
K(MY_SPEC.should_scan_index()), K(MY_SPEC.ref_table_id_));
|
||||
} else {
|
||||
if (MY_SPEC.partition_id_calc_type_ == 0) {
|
||||
output_id = data_tablet_loc->tablet_id_.id();
|
||||
} else if (MY_SPEC.partition_id_calc_type_ == 1) {
|
||||
|
@ -58,9 +58,7 @@ const char *ObLogGranuleIterator::get_name() const
|
||||
int ObLogGranuleIterator::get_op_exprs(ObIArray<ObRawExpr*> &all_exprs)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (NULL != tablet_id_expr_ && OB_FAIL(all_exprs.push_back(tablet_id_expr_))) {
|
||||
LOG_WARN("failed to append expr", K(ret));
|
||||
} else if (OB_FAIL(ObLogicalOperator::get_op_exprs(all_exprs))) {
|
||||
if (OB_FAIL(ObLogicalOperator::get_op_exprs(all_exprs))) {
|
||||
LOG_WARN("failed to get exprs", K(ret));
|
||||
} else { /*do nothing*/ }
|
||||
return ret;
|
||||
@ -113,6 +111,18 @@ int ObLogGranuleIterator::get_plan_item_info(PlanText &plan_text,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObLogGranuleIterator::allocate_expr_post(ObAllocExprContext &ctx)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (OB_FAIL(ObLogicalOperator::allocate_expr_post(ctx))) {
|
||||
LOG_WARN("failed to allocate expr post", K(ret));
|
||||
} else if (NULL != tablet_id_expr_ &&
|
||||
OB_FAIL(get_plan()->get_optimizer_context().get_all_exprs().append(tablet_id_expr_))) {
|
||||
LOG_WARN("failed to append expr", K(ret));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObLogGranuleIterator::compute_op_ordering()
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
@ -80,6 +80,7 @@ public:
|
||||
int64_t get_repartition_ref_table_id() { return repartition_ref_table_id_; }
|
||||
virtual int get_plan_item_info(PlanText &plan_text,
|
||||
ObSqlPlanItem &plan_item) override;
|
||||
virtual int allocate_expr_post(ObAllocExprContext &ctx) override;
|
||||
|
||||
void set_used_by_external_table() { used_by_external_table_ = true; }
|
||||
bool is_used_by_external_table() const { return used_by_external_table_; }
|
||||
|
@ -44,7 +44,7 @@ Outputs & filters:
|
||||
7 - output([t2.c1]), filter(nil), rowset=256
|
||||
(#keys=1, [t2.c1]), dop=3
|
||||
8 - output([t2.c1]), filter(nil), rowset=256
|
||||
9 - output([t2.c1], [PARTITION_ID]), filter(nil), rowset=256
|
||||
9 - output([t2.c1]), filter(nil), rowset=256
|
||||
access([t2.c1]), partitions(p[0-5])
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([t2.c1]), range(MIN ; MAX)always true
|
||||
@ -110,7 +110,7 @@ Outputs & filters:
|
||||
range_key([b.c1]), range(MIN ; MAX)always true
|
||||
12 - output([a.c1], [a.c2]), filter(nil), rowset=256
|
||||
affinitize
|
||||
13 - output([a.c1], [a.c2], [PARTITION_ID]), filter(nil), rowset=256
|
||||
13 - output([a.c1], [a.c2]), filter(nil), rowset=256
|
||||
access([a.c1], [a.c2]), partitions(p[0-9])
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([a.c1]), range(MIN ; MAX)always true
|
||||
|
@ -371,7 +371,7 @@ Outputs & filters:
|
||||
range_key([t_p4.c1]), range[5 ; MAX),
|
||||
range_cond([t_p4.c1 >= 5])
|
||||
9 - output([t_p.c1], [t_p.c2], [t_p.c3]), filter(nil), rowset=256
|
||||
10 - output([t_p.c1], [t_p.c2], [t_p.c3], [PARTITION_ID]), filter(nil), rowset=256
|
||||
10 - output([t_p.c1], [t_p.c2], [t_p.c3]), filter(nil), rowset=256
|
||||
access([t_p.c1], [t_p.c2], [t_p.c3]), partitions(p[0-3])
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([t_p.c1]), range[5 ; MAX),
|
||||
@ -427,7 +427,7 @@ Outputs & filters:
|
||||
is_index_back=false, is_global_index=false, filter_before_indexback[false],
|
||||
range_key([t_p4.c1]), range(MIN ; MAX)always true
|
||||
9 - output([t_p.c1], [t_p.c2], [t_p.c3]), filter(nil), rowset=256
|
||||
10 - output([t_p.c1], [t_p.c2], [t_p.c3], [PARTITION_ID]), filter(nil), rowset=256
|
||||
10 - output([t_p.c1], [t_p.c2], [t_p.c3]), filter(nil), rowset=256
|
||||
access([t_p.c1], [t_p.c2], [t_p.c3]), partitions(p[0-3])
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([t_p.c1]), range[5 ; MAX),
|
||||
@ -469,7 +469,7 @@ Outputs & filters:
|
||||
is_index_back=false, is_global_index=false, filter_before_indexback[false],
|
||||
range_key([t_p4.c1]), range(MIN ; MAX)always true
|
||||
9 - output([t_p.c1], [t_p.c2], [t_p.c3]), filter(nil), rowset=256
|
||||
10 - output([t_p.c1], [t_p.c2], [t_p.c3], [PARTITION_ID]), filter(nil), rowset=256
|
||||
10 - output([t_p.c1], [t_p.c2], [t_p.c3]), filter(nil), rowset=256
|
||||
access([t_p.c1], [t_p.c2], [t_p.c3]), partitions(p[0-3])
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([t_p.c1]), range[5 ; MAX),
|
||||
@ -661,7 +661,7 @@ Outputs & filters:
|
||||
8 - output([t_p.c1]), filter(nil), rowset=256
|
||||
dop=10
|
||||
9 - output([t_p.c1]), filter(nil), rowset=256
|
||||
10 - output([t_p.c1], [PARTITION_ID]), filter(nil), rowset=256
|
||||
10 - output([t_p.c1]), filter(nil), rowset=256
|
||||
access([t_p.c1]), partitions(p[0-3])
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([t_p.c1]), range(MIN ; MAX)always true
|
||||
@ -1948,7 +1948,7 @@ Outputs & filters:
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([t_temp_p5.__pk_increment]), range(MIN ; MAX)always true
|
||||
10 - output([t_temp_p.c1], [t_temp_p.c2], [t_temp_p.c3]), filter(nil), rowset=256
|
||||
11 - output([t_temp_p.c1], [t_temp_p.c2], [t_temp_p.c3], [PARTITION_ID]), filter(nil), rowset=256
|
||||
11 - output([t_temp_p.c1], [t_temp_p.c2], [t_temp_p.c3]), filter(nil), rowset=256
|
||||
access([t_temp_p.c1], [t_temp_p.c2], [t_temp_p.c3]), partitions(p[0-3])
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([t_temp_p.__pk_increment]), range(MIN ; MAX)always true
|
||||
@ -1994,7 +1994,7 @@ Outputs & filters:
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([t_temp_p5.__pk_increment]), range(MIN ; MAX)always true
|
||||
10 - output([t_temp_p.c1], [t_temp_p.c2], [t_temp_p.c3]), filter(nil), rowset=256
|
||||
11 - output([t_temp_p.c1], [t_temp_p.c2], [t_temp_p.c3], [PARTITION_ID]), filter(nil), rowset=256
|
||||
11 - output([t_temp_p.c1], [t_temp_p.c2], [t_temp_p.c3]), filter(nil), rowset=256
|
||||
access([t_temp_p.c1], [t_temp_p.c2], [t_temp_p.c3]), partitions(p[0-3])
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([t_temp_p.__pk_increment]), range(MIN ; MAX)always true
|
||||
@ -2114,7 +2114,7 @@ Outputs & filters:
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([t_temp_p4.__pk_increment]), range(MIN ; MAX)always true
|
||||
10 - output([t_temp_p.c1], [t_temp_p.c2], [t_temp_p.c3]), filter(nil), rowset=256
|
||||
11 - output([t_temp_p.c1], [t_temp_p.c2], [t_temp_p.c3], [PARTITION_ID]), filter(nil), rowset=256
|
||||
11 - output([t_temp_p.c1], [t_temp_p.c2], [t_temp_p.c3]), filter(nil), rowset=256
|
||||
access([t_temp_p.c1], [t_temp_p.c2], [t_temp_p.c3]), partitions(p[0-3])
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([t_temp_p.__pk_increment]), range(MIN ; MAX)always true
|
||||
|
@ -320,7 +320,7 @@ Outputs & filters:
|
||||
8 - output([a.c1], [a.c2]), filter(nil), rowset=256
|
||||
(#keys=1, [a.c1]), dop=2
|
||||
9 - output([a.c1], [a.c2]), filter(nil), rowset=256
|
||||
10 - output([a.c1], [a.c2], [PARTITION_ID]), filter(nil), rowset=256
|
||||
10 - output([a.c1], [a.c2]), filter(nil), rowset=256
|
||||
access([a.c1], [a.c2]), partitions(p[0-4])
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([a.__pk_increment]), range(MIN ; MAX)always true
|
||||
|
Loading…
x
Reference in New Issue
Block a user