From 402c9f0c5aaac9380612d8da6d65555dc2051ac6 Mon Sep 17 00:00:00 2001 From: qianchanger Date: Wed, 17 May 2023 05:41:27 +0000 Subject: [PATCH] Fix part join filter report -4021 --- src/sql/optimizer/ob_log_table_scan.h | 8 ++++++-- src/sql/optimizer/ob_logical_operator.cpp | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/sql/optimizer/ob_log_table_scan.h b/src/sql/optimizer/ob_log_table_scan.h index 931fae7a21..ba9454d121 100644 --- a/src/sql/optimizer/ob_log_table_scan.h +++ b/src/sql/optimizer/ob_log_table_scan.h @@ -72,6 +72,7 @@ public: fq_type_(TableItem::NOT_USING), fq_read_tx_uncommitted_(false), bf_info_(), + part_join_filter_allocated_(false), group_id_expr_(nullptr), use_batch_(false), access_path_(NULL), @@ -436,6 +437,8 @@ public: inline const AccessPath* get_access_path() const { return access_path_; } void set_tablet_id_expr(ObOpPseudoColumnRawExpr *expr) { tablet_id_expr_ = expr; } void set_trans_info_expr(ObOpPseudoColumnRawExpr *expr) { trans_info_expr_ = expr; } + void set_part_join_filter_created(bool flag) { part_join_filter_allocated_ = flag; } + bool is_part_join_filter_created() { return part_join_filter_allocated_; } ObOpPseudoColumnRawExpr *get_tablet_id_expr() const { return tablet_id_expr_; } ObRawExpr *get_trans_info_expr() const { return trans_info_expr_; } void set_tablet_id_type(int64_t type) { tablet_id_type_ = type; } @@ -574,8 +577,9 @@ protected: // memeber variables ObRawExpr* fq_expr_; //flashback query expr TableItem::FlashBackQueryType fq_type_; //flashback query type bool fq_read_tx_uncommitted_; // whether flashback query read uncommitted changes in transaction - - ObPxBFStaticInfo bf_info_; // for join partition filter + // for join partition filter + ObPxBFStaticInfo bf_info_; + bool part_join_filter_allocated_; // end for partition join filter ObRawExpr *group_id_expr_; bool use_batch_; diff --git a/src/sql/optimizer/ob_logical_operator.cpp b/src/sql/optimizer/ob_logical_operator.cpp index d6e18f7e77..29e13676f9 100644 --- a/src/sql/optimizer/ob_logical_operator.cpp +++ b/src/sql/optimizer/ob_logical_operator.cpp @@ -4654,6 +4654,9 @@ int ObLogicalOperator::allocate_partition_join_filter(const ObIArrayget_type()) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpect operator type", K(ret)); + } else if (FALSE_IT(scan_op = static_cast(node))) { + } else if (scan_op->is_part_join_filter_created()) { + /*do nothing*/ } else if (OB_ISNULL(filter_create = factory.allocate(*(get_plan()), LOG_JOIN_FILTER))) { ret = OB_ALLOCATE_MEMORY_FAILED; LOG_ERROR("failed to allocate exchange nodes", K(ret)); @@ -4662,7 +4665,6 @@ int ObLogicalOperator::allocate_partition_join_filter(const ObIArray(this)->is_shared_hash_join(); - scan_op = static_cast(node); ObPxBFStaticInfo bf_info; join_filter_create = static_cast(filter_create); join_filter_create->set_is_create_filter(true); @@ -4687,6 +4689,7 @@ int ObLogicalOperator::allocate_partition_join_filter(const ObIArrayget_p2p_sequence_ids().at(0), right_has_exchange)); scan_op->set_join_filter_info(bf_info); + scan_op->set_part_join_filter_created(true); filter_id++; for (int j = 0; j < info.lexprs_.count() && OB_SUCC(ret); ++j) { ObRawExpr *expr = info.lexprs_.at(j);