ozankabak commented on code in PR #4852:
URL: https://github.com/apache/arrow-datafusion/pull/4852#discussion_r1064181925


##########
datafusion/physical-expr/src/aggregate/covariance.rs:
##########
@@ -291,19 +291,20 @@ impl Accumulator for CovarianceAccumulator {
         let mut arr1 = downcast_value!(values1, Float64Array).iter().flatten();
         let mut arr2 = downcast_value!(values2, Float64Array).iter().flatten();
 
-        for _i in 0..values1.len() {
-            let value1 = arr1.next();
-            let value2 = arr2.next();
+        for i in 0..values1.len() {
+            let value1 = match values1.is_valid(i) {
+                true => arr1.next(),
+                false => None,
+            };
+            let value2 = match values2.is_valid(i) {
+                true => arr2.next(),
+                false => None,
+            };
 
             if value1.is_none() || value2.is_none() {

Review Comment:
   Argh - I hate GH's line selection. I am referring to the `continue` check 
right below.



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