Skip to content

Commit

Permalink
Preserve UDAF distincit flag in serde (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
joroKr21 committed Aug 21, 2024
1 parent 6465608 commit 7f3eac7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions datafusion/proto/proto/datafusion.proto
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ message AggregateUDFExprNode {
repeated LogicalExprNode args = 2;
LogicalExprNode filter = 3;
repeated LogicalExprNode order_by = 4;
bool distinct = 5;
optional bytes fun_definition = 6;
}

Expand Down
17 changes: 17 additions & 0 deletions datafusion/proto/src/generated/pbjson.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions datafusion/proto/src/generated/prost.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion datafusion/proto/src/logical_plan/from_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ pub fn parse_expr(
Ok(Expr::AggregateFunction(expr::AggregateFunction::new_udf(
agg_fn,
parse_exprs(&pb.args, registry, codec)?,
false,
pb.distinct,
parse_optional_expr(pb.filter.as_deref(), registry, codec)?.map(Box::new),
parse_vec_expr(&pb.order_by, registry, codec)?,
None,
Expand Down
1 change: 1 addition & 0 deletions datafusion/proto/src/logical_plan/to_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ pub fn serialize_expr(
Some(e) => serialize_exprs(e, codec)?,
None => vec![],
},
distinct: *distinct,
fun_definition: (!buf.is_empty()).then_some(buf),
},
))),
Expand Down

0 comments on commit 7f3eac7

Please sign in to comment.