[Improvement] Simplify expressions for _vconjunct_ctx_ptr (#9816)
This commit is contained in:
@ -544,8 +544,8 @@ void OlapScanNode::remove_pushed_conjuncts(RuntimeState* state) {
|
||||
|
||||
// set vconjunct_ctx is empty, if all conjunct
|
||||
if (_direct_conjunct_size == 0) {
|
||||
if (_vconjunct_ctx_ptr.get() != nullptr) {
|
||||
(*_vconjunct_ctx_ptr.get())->close(state);
|
||||
if (_vconjunct_ctx_ptr != nullptr) {
|
||||
(*_vconjunct_ctx_ptr)->close(state);
|
||||
_vconjunct_ctx_ptr = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,20 +51,20 @@ Status ScanNode::prepare(RuntimeState* state) {
|
||||
// Expr tree specific forms do not require requirements.
|
||||
std::string ScanNode::_peel_pushed_vconjunct(RuntimeState* state,
|
||||
const std::function<bool(int)>& checker) {
|
||||
if (_vconjunct_ctx_ptr.get() == nullptr) {
|
||||
if (_vconjunct_ctx_ptr == nullptr) {
|
||||
return "null";
|
||||
}
|
||||
|
||||
int leaf_index = 0;
|
||||
vectorized::VExpr* conjunct_expr_root = (*_vconjunct_ctx_ptr.get())->root();
|
||||
vectorized::VExpr* conjunct_expr_root = (*_vconjunct_ctx_ptr)->root();
|
||||
|
||||
if (conjunct_expr_root != nullptr) {
|
||||
vectorized::VExpr* new_conjunct_expr_root = vectorized::VectorizedUtils::dfs_peel_conjunct(
|
||||
state, *_vconjunct_ctx_ptr.get(), conjunct_expr_root, leaf_index, checker);
|
||||
state, *_vconjunct_ctx_ptr, conjunct_expr_root, leaf_index, checker);
|
||||
if (new_conjunct_expr_root == nullptr) {
|
||||
_vconjunct_ctx_ptr = nullptr;
|
||||
_vconjunct_ctx_ptr.reset(nullptr);
|
||||
} else {
|
||||
(*_vconjunct_ctx_ptr.get())->set_root(new_conjunct_expr_root);
|
||||
(*_vconjunct_ctx_ptr)->set_root(new_conjunct_expr_root);
|
||||
return new_conjunct_expr_root->debug_string();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user