azhangd commented on code in PR #21548:
URL: https://github.com/apache/datafusion/pull/21548#discussion_r3139716240
##########
datafusion/spark/src/function/aggregate/avg.rs:
##########
@@ -343,7 +345,141 @@ where
])
}
+ fn convert_to_state(
+ &self,
+ values: &[ArrayRef],
+ opt_filter: Option<&BooleanArray>,
+ ) -> Result<Vec<ArrayRef>> {
+ let sums = values[0]
+ .as_primitive::<T>()
+ .clone()
+ .with_data_type(self.return_data_type.clone());
+
+ let counts = Int64Array::from_value(1, sums.len());
+
+ // null out filtered / null input rows
Review Comment:
Thanks @kosiew, done. Swapped to `filtered_null_mask`/`set_nulls` and pulled
in `datafusion-functions-aggregate-common`. The `convert_to_state` body matches
the built-in now.
--
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]