File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -306,6 +306,14 @@ pub struct ScalarFunctionArgs<'a, 'b> {
306
306
pub return_field : & ' b Field ,
307
307
}
308
308
309
+ impl < ' a , ' b > ScalarFunctionArgs < ' a , ' b > {
310
+ /// The return type of the function. See [`Self::return_field`] for more
311
+ /// details.
312
+ pub fn return_type ( & self ) -> & DataType {
313
+ self . return_field . data_type ( )
314
+ }
315
+ }
316
+
309
317
/// Information about arguments passed to the function
310
318
///
311
319
/// This structure contains metadata about how the function was called
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ impl ScalarUDFImpl for NamedStructFunc {
150
150
}
151
151
152
152
fn invoke_with_args ( & self , args : ScalarFunctionArgs ) -> Result < ColumnarValue > {
153
- let DataType :: Struct ( fields) = args. return_field . data_type ( ) else {
153
+ let DataType :: Struct ( fields) = args. return_type ( ) else {
154
154
return internal_err ! ( "incorrect named_struct return type" ) ;
155
155
} ;
156
156
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ impl ScalarUDFImpl for StructFunc {
117
117
}
118
118
119
119
fn invoke_with_args ( & self , args : ScalarFunctionArgs ) -> Result < ColumnarValue > {
120
- let DataType :: Struct ( fields) = args. return_field . data_type ( ) else {
120
+ let DataType :: Struct ( fields) = args. return_type ( ) else {
121
121
return internal_err ! ( "incorrect struct return type" ) ;
122
122
} ;
123
123
You can’t perform that action at this time.
0 commit comments