doki23 commented on a change in pull request #2068:
URL: https://github.com/apache/arrow-datafusion/pull/2068#discussion_r833872460



##########
File path: datafusion-physical-expr/src/expressions/case.rs
##########
@@ -523,6 +528,39 @@ mod tests {
         Ok(())
     }
 
+    #[test]
+    fn case_with_expr_divide_by_zero() -> Result<()> {
+        let batch = case_test_batch1()?;
+        let schema = batch.schema();
+
+        // CASE a when 0 THEN float64(null) ELSE 25.0 / cast(a, float64)  END
+        let when1 = lit(ScalarValue::Int32(Some(0)));

Review comment:
       We can evaluate `case_when` from beginning to the end and use 
`evaluate_selection` for the `when_expr` so that we can omit the following 
computation of the record whose `when_expr` is already true. Do I get your idea?




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


Reply via email to