felipecrv commented on code in PR #36424:
URL: https://github.com/apache/arrow/pull/36424#discussion_r1254523644
##########
cpp/src/arrow/compute/expression.cc:
##########
@@ -362,8 +362,20 @@ bool Expression::IsSatisfiable() const {
}
if (call->function_name == "and_kleene" || call->function_name == "and") {
- for (const Expression& arg : call->arguments) {
- if (!arg.IsSatisfiable()) return false;
+ bool has_unsatisfiable =
+ std::any_of(call->arguments.begin(), call->arguments.end(),
+ [](const Expression& arg) { return !arg.IsSatisfiable();
});
+ if (has_unsatisfiable) {
+ return false;
+ }
+ }
+
+ if (call->function_name == "or_kleene" || call->function_name == "or") {
+ bool all_unsatisfiable =
+ std::all_of(call->arguments.begin(), call->arguments.end(),
+ [](const Expression& arg) { return !arg.IsSatisfiable();
});
+ if (all_unsatisfiable) {
+ return false;
Review Comment:
I should have seen this. :D
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]