adriangb commented on code in PR #25684:
URL: https://github.com/apache/datafusion/pull/25684#discussion_r4299219941


##########
datafusion/physical-expr/src/expressions/case.rs:
##########
@@ -1531,15 +1524,24 @@ fn evaluate_predicate(predicate: &Arc<dyn 
PhysicalExpr>) -> Result<Option<bool>>
 
     // Evaluate the predicate and interpret the result as a boolean
     let result = match predicate.evaluate(&batch) {
-        // An error during evaluation means we couldn't const evaluate the 
predicate, so return `None`
-        Err(_) => None,
-        Ok(ColumnarValue::Array(array)) => Some(
+        Err(_) => {
+            if let Some(expr) = predicate.downcast_ref::<BinaryExpr>()

Review Comment:
   FYI: on error we evaluate each child again, and each child can fail and 
recurse again. For a long `AND`/`OR` chain this is O(n^2) evaluations at 
planning time. Could you take a look and see if this is worthy of a followup?



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to