Jefffrey commented on code in PR #18091:
URL: https://github.com/apache/datafusion/pull/18091#discussion_r2434714487
##########
datafusion/spark/src/function/aggregate/avg.rs:
##########
@@ -25,41 +25,37 @@ use arrow::array::{
use arrow::compute::sum;
use arrow::datatypes::{DataType, Field, FieldRef};
use datafusion_common::utils::take_function_args;
-use datafusion_common::{not_impl_err, Result, ScalarValue};
+use datafusion_common::{not_impl_err, plan_err, Result, ScalarValue};
use datafusion_expr::function::{AccumulatorArgs, StateFieldsArgs};
-use datafusion_expr::type_coercion::aggregates::coerce_avg_type;
use datafusion_expr::utils::format_state_name;
use datafusion_expr::Volatility::Immutable;
use datafusion_expr::{
- type_coercion::aggregates::avg_return_type, Accumulator, AggregateUDFImpl,
EmitTo,
- GroupsAccumulator, ReversedUDAF, Signature,
+ Accumulator, AggregateUDFImpl, EmitTo, GroupsAccumulator, ReversedUDAF,
Signature,
};
use std::{any::Any, sync::Arc};
-use DataType::*;
/// AVG aggregate expression
/// Spark average aggregate expression. Differs from standard DataFusion
average aggregate
/// in that it uses an `i64` for the count (DataFusion version uses `u64`);
also there is ANSI mode
/// support planned in the future for Spark version.
+// TODO: see if can deduplicate with DF version
Review Comment:
Actually it would fall under #17964
--
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]