Repository navigation
perf(expression): short-circuit And/Or in boolean evaluators - #1181
Merged
wgtmac merged 1 commit intoNov 28, 2026
Merged
Conversation
wgtmac
reviewed
Nov 27, 2026
| Result<bool> Evaluator::Evaluate(const StructLike& row) const { | ||
| EvalVisitor visitor(row); | ||
| return Visit<bool, EvalVisitor>(bound_expr_, visitor); | ||
| return VisitEvaluator(bound_expr_, visitor); |
Member
There was a problem hiding this comment.
Since #1166 merged, row evaluation runs compiled AndNode and OrNode instances. Please add short-circuiting to both nodes when rebasing, and update CompoundExpressionsKeepErrorsFromBothSides to verify that a skipped right operand is never read and a required one still propagates its error.
Contributor
Author
There was a problem hiding this comment.
ah yes let me rebase.
Skip the right child of And/Or when the left child decides the result, like Java's visitEvaluator. Errors from a skipped child are no longer reported. Closes apache#1118.
dino-saurabh
force-pushed
the
perf/short-circuit-boolean-evaluators
branch
from
November 27, 2026 06:27
eae7520 to
29d5716
Compare
wgtmac
approved these changes
Nov 28, 2026
wgtmac
left a comment
Member
There was a problem hiding this comment.
Thanks @dino-saurabh for working on this and @zhjwpku for the review!
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.
The generic Visit evaluates both children of And/Or before combining them, while Java's boolean evaluators use visitEvaluator, which skips the right child when the left child decides the result.
Closes #1118.