@@ -203,9 +203,6 @@ impl ScalarUDF {
203
203
self . inner . simplify ( args, info)
204
204
}
205
205
206
- /// Invoke the function on `args`, returning the appropriate result.
207
- ///
208
- /// See [`ScalarUDFImpl::invoke`] for more details.
209
206
#[ deprecated( since = "42.1.0" , note = "Use `invoke_batch` instead" ) ]
210
207
pub fn invoke ( & self , args : & [ ColumnarValue ] ) -> Result < ColumnarValue > {
211
208
#[ allow( deprecated) ]
@@ -227,6 +224,19 @@ impl ScalarUDF {
227
224
self . inner . invoke_batch ( args, number_rows)
228
225
}
229
226
227
+ /// Invoke the function on `args`, returning the appropriate result.
228
+ ///
229
+ /// See [`ScalarUDFImpl::invoke_batch`] for more details.
230
+ pub fn invoke_batch_with_return_type (
231
+ & self ,
232
+ args : & [ ColumnarValue ] ,
233
+ number_rows : usize ,
234
+ return_type : & DataType ,
235
+ ) -> Result < ColumnarValue > {
236
+ self . inner
237
+ . invoke_batch_with_return_type ( args, number_rows, return_type)
238
+ }
239
+
230
240
/// Invoke the function without `args` but number of rows, returning the appropriate result.
231
241
///
232
242
/// See [`ScalarUDFImpl::invoke_no_args`] for more details.
@@ -356,7 +366,7 @@ where
356
366
/// }
357
367
/// }
358
368
/// }
359
- ///
369
+ ///
360
370
/// static DOCUMENTATION: OnceLock<Documentation> = OnceLock::new();
361
371
///
362
372
/// fn get_doc() -> &'static Documentation {
@@ -537,6 +547,17 @@ pub trait ScalarUDFImpl: Debug + Send + Sync {
537
547
}
538
548
}
539
549
550
+ /// This function will be called with the evaluated children as in `invoke` however, the value
551
+ /// returned previously from `ScalarUDFImpl::return_type` for this expr will be passed in.
552
+ fn invoke_batch_with_return_type (
553
+ & self ,
554
+ args : & [ ColumnarValue ] ,
555
+ number_rows : usize ,
556
+ _return_type : & DataType ,
557
+ ) -> Result < ColumnarValue > {
558
+ self . invoke_batch ( args, number_rows)
559
+ }
560
+
540
561
/// Invoke the function without `args`, instead the number of rows are provided,
541
562
/// returning the appropriate result.
542
563
#[ deprecated( since = "42.1.0" , note = "Use `invoke_batch` instead" ) ]
0 commit comments