alamb commented on code in PR #14181:
URL: https://github.com/apache/datafusion/pull/14181#discussion_r1921107747


##########
datafusion/functions-aggregate/src/correlation.rs:
##########
@@ -487,17 +487,14 @@ impl GroupsAccumulator for CorrelationGroupsAccumulator {
             if denominator == 0.0 {
                 // TODO: Evaluate as `Null` (see notes above)
                 values.push(0.0);
-                nulls.append(false);
+                nulls.append_null();
             } else {
                 values.push(numerator / denominator);
-                nulls.append(true);
+                nulls.append_non_null();
             }
         }
 
-        Ok(Arc::new(Float64Array::new(
-            values.into(),
-            Some(nulls.finish().into()),
-        )))
+        Ok(Arc::new(Float64Array::new(values.into(), nulls.finish())))

Review Comment:
   ❤️  -- it is great. Again this will avoid creating a NullBuffer if the input 
had no nulls



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