diff --git a/src/expr/core/src/aggregate/def.rs b/src/expr/core/src/aggregate/def.rs index edacd01224639..638dde18f4d12 100644 --- a/src/expr/core/src/aggregate/def.rs +++ b/src/expr/core/src/aggregate/def.rs @@ -249,7 +249,7 @@ impl FromStr for AggKind { impl From for AggKind { fn from(pb: PbAggKind) -> Self { - assert!(matches!( + assert!(!matches!( pb, PbAggKind::Unspecified | PbAggKind::UserDefined | PbAggKind::WrapScalar )); @@ -283,7 +283,7 @@ impl AggKind { pub fn to_protobuf(&self) -> PbAggKind { match self { - Self::Builtin(pb) => pb.clone(), + Self::Builtin(pb) => *pb, Self::UserDefined(_) => PbAggKind::UserDefined, Self::WrapScalar(_) => PbAggKind::WrapScalar, } diff --git a/src/expr/core/src/aggregate/user_defined.rs b/src/expr/core/src/aggregate/user_defined.rs index 7bb4128684fc3..a3897896a3a67 100644 --- a/src/expr/core/src/aggregate/user_defined.rs +++ b/src/expr/core/src/aggregate/user_defined.rs @@ -153,7 +153,7 @@ pub fn new_user_defined( )); Ok(Box::new(UserDefinedAggregateFunction { - return_field: arrow_convert.to_arrow_field("", &return_type)?, + return_field: arrow_convert.to_arrow_field("", return_type)?, state_field: Field::new("state", arrow_schema::DataType::Binary, true), return_type: return_type.clone(), arg_schema,