@@ -97,6 +97,7 @@ impl TryFrom<AccumulatorArgs<'_>> for FFI_AccumulatorArgs {
9797pub struct ForeignAccumulatorArgs {
9898 pub return_field : FieldRef ,
9999 pub schema : Schema ,
100+ pub expr_fields : Vec < FieldRef > ,
100101 pub ignore_nulls : bool ,
101102 pub order_bys : Vec < PhysicalSortExpr > ,
102103 pub is_reversed : bool ,
@@ -132,9 +133,15 @@ impl TryFrom<FFI_AccumulatorArgs> for ForeignAccumulatorArgs {
132133
133134 let exprs = parse_physical_exprs ( & proto_def. expr , & task_ctx, & schema, & codex) ?;
134135
136+ let expr_fields = exprs
137+ . iter ( )
138+ . map ( |e| e. return_field ( & schema) )
139+ . collect :: < Result < Vec < _ > , _ > > ( ) ?;
140+
135141 Ok ( Self {
136142 return_field,
137143 schema,
144+ expr_fields,
138145 ignore_nulls : proto_def. ignore_nulls ,
139146 order_bys,
140147 is_reversed : value. is_reversed ,
@@ -150,6 +157,7 @@ impl<'a> From<&'a ForeignAccumulatorArgs> for AccumulatorArgs<'a> {
150157 Self {
151158 return_field : Arc :: clone ( & value. return_field ) ,
152159 schema : & value. schema ,
160+ expr_fields : & value. expr_fields ,
153161 ignore_nulls : value. ignore_nulls ,
154162 order_bys : & value. order_bys ,
155163 is_reversed : value. is_reversed ,
@@ -175,6 +183,7 @@ mod tests {
175183 let orig_args = AccumulatorArgs {
176184 return_field : Field :: new ( "f" , DataType :: Float64 , true ) . into ( ) ,
177185 schema : & schema,
186+ expr_fields : & [ Field :: new ( "a" , DataType :: Int32 , true ) . into ( ) ] ,
178187 ignore_nulls : false ,
179188 order_bys : & [ PhysicalSortExpr :: new_default ( col ( "a" , & schema) ?) ] ,
180189 is_reversed : false ,
0 commit comments