dqkqd commented on code in PR #18024:
URL: https://github.com/apache/datafusion/pull/18024#discussion_r2427385050
##########
datafusion/proto/src/logical_plan/from_proto.rs:
##########
@@ -571,14 +596,27 @@ pub fn parse_expr(
.udaf(&pb.fun_name)
.or_else(|_| codec.try_decode_udaf(&pb.fun_name, &[]))?,
};
+ let null_treatment = match pb.null_treatment {
+ Some(null_treatment) => {
+ let null_treatment =
protobuf::NullTreatment::try_from(null_treatment)
+ .map_err(|_| {
+ proto_error(format!(
+ "Received an AggregateUdfExprNode message with
unknown NullTreatment {}",
+ null_treatment
+ ))
+ })?;
+ Some(null_treatment.try_into()?)
+ }
+ None => None,
+ };
Ok(Expr::AggregateFunction(expr::AggregateFunction::new_udf(
agg_fn,
parse_exprs(&pb.args, registry, codec)?,
pb.distinct,
parse_optional_expr(pb.filter.as_deref(), registry,
codec)?.map(Box::new),
parse_sorts(&pb.order_by, registry, codec)?,
- None,
+ null_treatment,
Review Comment:
Noticed that we don't have `null_treatment` for aggregate udf.
So I handle this as well.
--
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]