Skip to content

Commit 7f3eac7

Browse files
authored
Preserve UDAF distincit flag in serde (#259)
1 parent 6465608 commit 7f3eac7

File tree

5 files changed

+22
-1
lines changed

5 files changed

+22
-1
lines changed

datafusion/proto/proto/datafusion.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ message AggregateUDFExprNode {
522522
repeated LogicalExprNode args = 2;
523523
LogicalExprNode filter = 3;
524524
repeated LogicalExprNode order_by = 4;
525+
bool distinct = 5;
525526
optional bytes fun_definition = 6;
526527
}
527528

datafusion/proto/src/generated/pbjson.rs

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

datafusion/proto/src/generated/prost.rs

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

datafusion/proto/src/logical_plan/from_proto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ pub fn parse_expr(
658658
Ok(Expr::AggregateFunction(expr::AggregateFunction::new_udf(
659659
agg_fn,
660660
parse_exprs(&pb.args, registry, codec)?,
661-
false,
661+
pb.distinct,
662662
parse_optional_expr(pb.filter.as_deref(), registry, codec)?.map(Box::new),
663663
parse_vec_expr(&pb.order_by, registry, codec)?,
664664
None,

datafusion/proto/src/logical_plan/to_proto.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ pub fn serialize_expr(
502502
Some(e) => serialize_exprs(e, codec)?,
503503
None => vec![],
504504
},
505+
distinct: *distinct,
505506
fun_definition: (!buf.is_empty()).then_some(buf),
506507
},
507508
))),

0 commit comments

Comments
 (0)