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> {
306306 pub return_field : & ' b Field ,
307307}
308308
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+
309317/// Information about arguments passed to the function
310318///
311319/// 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 {
150150 }
151151
152152 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 {
154154 return internal_err ! ( "incorrect named_struct return type" ) ;
155155 } ;
156156
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ impl ScalarUDFImpl for StructFunc {
117117 }
118118
119119 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 {
121121 return internal_err ! ( "incorrect struct return type" ) ;
122122 } ;
123123
You can’t perform that action at this time.
0 commit comments