This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 3e84c04195 [Bug](predicate) fix nullptr in scan node (#13316) 3e84c04195 is described below commit 3e84c041953f510fb068768ea1a67339d3dd805f Author: Gabriel <gabrielleeb...@gmail.com> AuthorDate: Thu Oct 13 12:14:42 2022 +0800 [Bug](predicate) fix nullptr in scan node (#13316) --- be/src/vec/exec/scan/vscan_node.cpp | 11 ++++++----- be/src/vec/exec/volap_scan_node.cpp | 10 ++++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/be/src/vec/exec/scan/vscan_node.cpp b/be/src/vec/exec/scan/vscan_node.cpp index 6f6f5a1f38..1718d83697 100644 --- a/be/src/vec/exec/scan/vscan_node.cpp +++ b/be/src/vec/exec/scan/vscan_node.cpp @@ -405,9 +405,11 @@ VExpr* VScanNode::_normalize_predicate(VExpr* conjunct_expr_root) { ColumnValueRangeType* range = nullptr; PushDownType pdt = PushDownType::UNACCEPTABLE; _eval_const_conjuncts(cur_expr, *_vconjunct_ctx_ptr, &pdt); - if (pdt == PushDownType::UNACCEPTABLE && - (_is_predicate_acting_on_slot(cur_expr, in_predicate_checker, &slot, &range) || - _is_predicate_acting_on_slot(cur_expr, eq_predicate_checker, &slot, &range))) { + if (pdt == PushDownType::ACCEPTABLE) { + return nullptr; + } + if (_is_predicate_acting_on_slot(cur_expr, in_predicate_checker, &slot, &range) || + _is_predicate_acting_on_slot(cur_expr, eq_predicate_checker, &slot, &range)) { std::visit( [&](auto& value_range) { RETURN_IF_PUSH_DOWN(_normalize_in_and_eq_predicate( @@ -433,8 +435,7 @@ VExpr* VScanNode::_normalize_predicate(VExpr* conjunct_expr_root) { }, *range); } - if (pdt == PushDownType::ACCEPTABLE && slot != nullptr && - _is_key_column(slot->col_name())) { + if (pdt == PushDownType::ACCEPTABLE && _is_key_column(slot->col_name())) { return nullptr; } else { // for PARTIAL_ACCEPTABLE and UNACCEPTABLE, do not remove expr from the tree diff --git a/be/src/vec/exec/volap_scan_node.cpp b/be/src/vec/exec/volap_scan_node.cpp index 0b7ba331af..b8eb4ae262 100644 --- a/be/src/vec/exec/volap_scan_node.cpp +++ b/be/src/vec/exec/volap_scan_node.cpp @@ -1702,13 +1702,15 @@ VExpr* VOlapScanNode::_normalize_predicate(RuntimeState* state, VExpr* conjunct_ if (is_leaf(conjunct_expr_root)) { auto impl = conjunct_expr_root->get_impl(); VExpr* cur_expr = impl ? const_cast<VExpr*>(impl) : conjunct_expr_root; - SlotDescriptor* slot; + SlotDescriptor* slot = nullptr; ColumnValueRangeType* range = nullptr; bool push_down = false; eval_const_conjuncts(cur_expr, *(_vconjunct_ctx_ptr.get()), &push_down); - if (!push_down && - (_is_predicate_acting_on_slot(cur_expr, in_predicate_checker, &slot, &range) || - _is_predicate_acting_on_slot(cur_expr, eq_predicate_checker, &slot, &range))) { + if (push_down) { + return nullptr; + } + if (_is_predicate_acting_on_slot(cur_expr, in_predicate_checker, &slot, &range) || + _is_predicate_acting_on_slot(cur_expr, eq_predicate_checker, &slot, &range)) { std::visit( [&](auto& value_range) { RETURN_IF_PUSH_DOWN(_normalize_in_and_eq_predicate( --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org