Jefffrey commented on code in PR #19727:
URL: https://github.com/apache/datafusion/pull/19727#discussion_r2710868926
##########
datafusion/functions-aggregate/src/variance.rs:
##########
@@ -561,9 +535,9 @@ impl GroupsAccumulator for VarianceGroupsAccumulator {
) -> Result<()> {
assert_eq!(values.len(), 3, "two arguments to merge_batch");
// first batch is counts, second is partial means, third is partial m2s
- let partial_counts = downcast_value!(values[0], UInt64Array);
Review Comment:
I have definitely found it a little confusing all the ways we can do
downcasting, for example:
-
https://docs.rs/datafusion/latest/datafusion/common/cast/fn.as_primitive_array.html
-
https://docs.rs/datafusion/latest/datafusion/common/macro.downcast_value.html
-
https://docs.rs/arrow/latest/arrow/array/trait.AsArray.html#method.as_primitive
-
https://docs.rs/arrow/latest/arrow/array/trait.AsArray.html#tymethod.as_primitive_opt
- https://docs.rs/arrow/latest/arrow/array/fn.as_primitive_array.html
- Manual `downcast_ref`
While they all do have slightly different behaviours (with how they treat
erroring and such), it would help to be consistent 🤔
We could make `downcast_value!` deprecated and eventually try to make it
private to common
--
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]