[refactor](exec) replace the single pointer with an array of 'conjuncts' in ExecNode (#19758)
Refactoring the filtering conditions in the current ExecNode from an expression tree to an array can simplify the process of adding runtime filters. It eliminates the need for complex merge operations and removes the requirement for the frontend to combine expressions into a single entity. By representing the filtering conditions as an array, each condition can be treated individually, making it easier to add runtime filters without the need for complex merging logic. The array can store the individual conditions, and the runtime filter logic can iterate through the array to apply the filters as needed. This refactoring simplifies the codebase, improves readability, and reduces the complexity associated with handling filtering conditions and adding runtime filters. It separates the conditions into discrete entities, enabling more straightforward manipulation and management within the execution node.
This commit is contained in:
@ -54,28 +54,4 @@ Status ScanNode::prepare(RuntimeState* state) {
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
// This function is used to remove pushed expr in expr tree.
|
||||
// It relies on the logic of function convertConjunctsToAndCompoundPredicate() of FE splicing expr.
|
||||
// It requires FE to satisfy each splicing with 'and' expr, and spliced from left to right, in order.
|
||||
// Expr tree specific forms do not require requirements.
|
||||
void ScanNode::_peel_pushed_vconjunct(RuntimeState* state,
|
||||
const std::function<bool(int)>& checker) {
|
||||
if (_vconjunct_ctx_ptr == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
int leaf_index = 0;
|
||||
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, conjunct_expr_root, leaf_index, checker);
|
||||
if (new_conjunct_expr_root == nullptr) {
|
||||
_vconjunct_ctx_ptr->close(state);
|
||||
} else {
|
||||
_vconjunct_ctx_ptr->set_root(new_conjunct_expr_root);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace doris
|
||||
|
||||
Reference in New Issue
Block a user