crepererum commented on code in PR #12178:
URL: https://github.com/apache/datafusion/pull/12178#discussion_r1732636238
##########
datafusion/proto/src/logical_plan/from_proto.rs:
##########
@@ -586,7 +586,10 @@ pub fn parse_expr(
parse_exprs(&pb.args, registry, codec)?,
pb.distinct,
parse_optional_expr(pb.filter.as_deref(), registry,
codec)?.map(Box::new),
- parse_vec_expr(&pb.order_by, registry, codec)?,
+ match pb.order_by.len() {
+ 0 => None,
+ _ => Some(parse_exprs(&pb.order_by, registry, codec)?),
+ },
Review Comment:
> Empty collection perfectly describes lack of sorting, so no need to wrap
if with optional value.
Let's try to do that then. I agree that having an `Option<Vec<_>>` in
`new_udf` doesn't make much sense.
--
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]