[Improvement] Simplify expressions for _vconjunct_ctx_ptr (#9816)

This commit is contained in:
Gabriel
2022-05-29 23:05:21 +08:00
committed by GitHub
parent 63aab5ee5d
commit a96b41db7a
2 changed files with 7 additions and 7 deletions

View File

@ -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();
}
}