Skip to content

Commit bb16e43

Browse files
committed
update signature
1 parent 7c0721d commit bb16e43

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

datafusion/expr-common/src/type_coercion/aggregates.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ pub fn avg_sum_type(arg_type: &DataType) -> Result<DataType> {
232232
Ok(DataType::Decimal256(new_precision, *scale))
233233
}
234234
arg_type if NUMERICS.contains(arg_type) => Ok(DataType::Float64),
235+
DataType::Duration(time_unit) => Ok(DataType::Duration(*time_unit)),
235236
DataType::Dictionary(_, dict_value_type) => {
236237
avg_sum_type(dict_value_type.as_ref())
237238
}
@@ -298,6 +299,7 @@ pub fn coerce_avg_type(func_name: &str, arg_types: &[DataType]) -> Result<Vec<Da
298299
DataType::Decimal128(p, s) => Ok(DataType::Decimal128(*p, *s)),
299300
DataType::Decimal256(p, s) => Ok(DataType::Decimal256(*p, *s)),
300301
d if d.is_numeric() => Ok(DataType::Float64),
302+
DataType::Duration(time_unit) => Ok(DataType::Duration(*time_unit)),
301303
DataType::Dictionary(_, v) => coerced_type(func_name, v.as_ref()),
302304
_ => {
303305
plan_err!(

0 commit comments

Comments
 (0)