diff --git a/datafusion/physical-expr-common/src/aggregate/groups_accumulator/prim_op.rs b/datafusion/physical-expr-common/src/aggregate/groups_accumulator/prim_op.rs index 8d69646bd422a..1fa9cef94d32a 100644 --- a/datafusion/physical-expr-common/src/aggregate/groups_accumulator/prim_op.rs +++ b/datafusion/physical-expr-common/src/aggregate/groups_accumulator/prim_op.rs @@ -185,6 +185,8 @@ where ) })? .map_err(DataFusionError::from)?; + let state_values = state_values + .with_data_type(self.data_type.clone()); Ok(vec![Arc::new(state_values)]) }