diff --git a/datafusion/functions-aggregate/src/correlation.rs b/datafusion/functions-aggregate/src/correlation.rs index 8b1ef72bc3c0..de48f36c46d8 100644 --- a/datafusion/functions-aggregate/src/correlation.rs +++ b/datafusion/functions-aggregate/src/correlation.rs @@ -527,13 +527,12 @@ impl GroupsAccumulator for CorrelationGroupsAccumulator { } fn size(&self) -> usize { - size_of::() - * (self.count.capacity() - + self.sum_x.capacity() - + self.sum_y.capacity() - + self.sum_xy.capacity() - + self.sum_xx.capacity() - + self.sum_yy.capacity()) + size_of_val(&self.count) + + size_of_val(&self.sum_x) + + size_of_val(&self.sum_y) + + size_of_val(&self.sum_xy) + + size_of_val(&self.sum_xx) + + size_of_val(&self.sum_yy) } }