eejbyfeldt commented on code in PR #13248:
URL: https://github.com/apache/datafusion/pull/13248#discussion_r1828338766


##########
datafusion/functions-aggregate/src/variance.rs:
##########
@@ -316,6 +316,7 @@ fn merge(
     mean2: f64,
     m22: f64,
 ) -> (u64, f64, f64) {
+    debug_assert!(count != 0 || count2 != 0, "Cannot merge two empty states");

Review Comment:
   It is a precondition of using this function. So support is not needed here, 
but expected to be handled by callers. When both counts are 0 then also `mean` 
and `m2` is 0 and the correct result would also be all 0.



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