Jefffrey commented on code in PR #18024:
URL: https://github.com/apache/datafusion/pull/18024#discussion_r2427753952


##########
datafusion/proto/proto/datafusion.proto:
##########
@@ -622,6 +626,12 @@ message WindowFrameBound {
   datafusion_common.ScalarValue bound_value = 2;
 }
 
+enum NullTreatment {
+  NULL_TREATMENT_UNSPECIFIED = 0;

Review Comment:
   I guess we never did it before because we don't try to maintain version 
compatibility:
   
   
https://github.com/apache/datafusion/blob/b27fedcd3224f305e29ef4e67de232842808f650/datafusion/proto/src/lib.rs#L46-L50



##########
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:
   Nice catch



-- 
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]

Reply via email to