[chore](expr) remove useless if in is_acting_on_a_slot#63095
Merged
yiguolei merged 1 commit intoapache:masterfrom May 10, 2026
Merged
[chore](expr) remove useless if in is_acting_on_a_slot#63095yiguolei merged 1 commit intoapache:masterfrom
is_acting_on_a_slot#63095yiguolei merged 1 commit intoapache:masterfrom
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Member
Author
|
run buildall |
Member
Author
|
/review |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR simplifies BE expression analysis by removing the special-case SEARCH_EXPR handling from VExpr::is_acting_on_a_slot(), relying solely on recursive detection of SLOT_REF / VIRTUAL_SLOT_REF descendants.
Changes:
- Remove the early-return branch that treated
TExprNodeType::SEARCH_EXPRas automatically “acting on a slot”. - Keep slot-detection logic purely recursive over the expression tree.
Comments suppressed due to low confidence (1)
be/src/exprs/vexpr.cpp:350
- Removing the SEARCH_EXPR fast-path changes
is_acting_on_a_slot()to depend solely on finding SLOT_REF/VIRTUAL_SLOT_REF in the subtree. If a SEARCH_EXPR is ever constructed without slot-ref children (e.g., due to FE/BE version skew or an upstream bug), it will no longer be treated as “acting on a slot” and won’t be moved into_common_expr_ctxs_push_down, which can later triggerVSearchExpr's runtime error path (it cannot execute without inverted index /fast_execute). Consider keeping the explicit SEARCH_EXPR handling here, or add a hard invariant (e.g., DCHECK/validation) that SEARCH_EXPR always has slot-ref descendants before relying on the recursive logic.
bool VExpr::is_acting_on_a_slot(const VExpr& expr) {
const auto& children = expr.children();
auto is_a_slot = std::any_of(children.begin(), children.end(),
[](const auto& child) { return is_acting_on_a_slot(*child); });
return is_a_slot ? true
: (expr.node_type() == TExprNodeType::SLOT_REF ||
expr.node_type() == TExprNodeType::VIRTUAL_SLOT_REF);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Review result: no blocking issues found.
Critical checkpoint conclusions:
- Goal: removes a redundant special case in
VExpr::is_acting_on_a_slot; currentSEARCH_EXPRgeneration already attaches slot/slot-derived children, so the recursive logic preserves behavior. - Scope: the change is minimal and focused to one helper.
- Concurrency/lifecycle/config/compatibility/persistence: not applicable; no shared state, lifecycle, config, wire/storage format, or persistence change.
- Parallel code paths: only known caller is scan predicate normalization; reviewed search expression construction and BE
VSearchExprhandling for this path. - Test coverage: no new test was added, but this is a narrow cleanup and existing search predicate translation tests cover slot children in generated
SEARCH_EXPRnodes. I did not run tests in this review runner. - Observability/performance: no additional observability needed; performance impact is negligible.
- User focus: no additional user-provided review focus.
Contributor
TPC-H: Total hot run time: 29617 ms |
Contributor
TPC-DS: Total hot run time: 171399 ms |
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
Member
Author
yiguolei
approved these changes
May 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.