2020use crate :: expr:: schema_name_from_exprs_comma_separated_without_space;
2121use crate :: simplify:: { ExprSimplifyResult , SimplifyInfo } ;
2222use crate :: sort_properties:: { ExprProperties , SortProperties } ;
23- use crate :: {
24- ColumnarValue , Documentation , Expr , ScalarFunctionImplementation , Signature ,
25- } ;
23+ use crate :: { ColumnarValue , Documentation , Expr , Signature } ;
2624use arrow:: datatypes:: DataType ;
2725use datafusion_common:: { not_impl_err, ExprSchema , Result , ScalarValue } ;
2826use datafusion_expr_common:: interval_arithmetic:: Interval ;
@@ -198,53 +196,18 @@ impl ScalarUDF {
198196 self . inner . simplify ( args, info)
199197 }
200198
201- #[ deprecated( since = "42.1.0" , note = "Use `invoke_with_args` instead" ) ]
202- pub fn invoke ( & self , args : & [ ColumnarValue ] ) -> Result < ColumnarValue > {
203- #[ allow( deprecated) ]
204- self . inner . invoke ( args)
205- }
206-
207199 #[ allow( deprecated) ]
208200 pub fn is_nullable ( & self , args : & [ Expr ] , schema : & dyn ExprSchema ) -> bool {
209201 self . inner . is_nullable ( args, schema)
210202 }
211203
212- #[ deprecated( since = "46.0.0" , note = "Use `invoke_with_args` instead" ) ]
213- pub fn invoke_batch (
214- & self ,
215- args : & [ ColumnarValue ] ,
216- number_rows : usize ,
217- ) -> Result < ColumnarValue > {
218- #[ allow( deprecated) ]
219- self . inner . invoke_batch ( args, number_rows)
220- }
221-
222204 /// Invoke the function on `args`, returning the appropriate result.
223205 ///
224206 /// See [`ScalarUDFImpl::invoke_with_args`] for details.
225207 pub fn invoke_with_args ( & self , args : ScalarFunctionArgs ) -> Result < ColumnarValue > {
226208 self . inner . invoke_with_args ( args)
227209 }
228210
229- /// Invoke the function without `args` but number of rows, returning the appropriate result.
230- ///
231- /// Note: This method is deprecated and will be removed in future releases.
232- /// User defined functions should implement [`Self::invoke_with_args`] instead.
233- #[ deprecated( since = "42.1.0" , note = "Use `invoke_with_args` instead" ) ]
234- pub fn invoke_no_args ( & self , number_rows : usize ) -> Result < ColumnarValue > {
235- #[ allow( deprecated) ]
236- self . inner . invoke_no_args ( number_rows)
237- }
238-
239- /// Returns a `ScalarFunctionImplementation` that can invoke the function
240- /// during execution
241- #[ deprecated( since = "42.0.0" , note = "Use `invoke_with_args` instead" ) ]
242- pub fn fun ( & self ) -> ScalarFunctionImplementation {
243- let captured = Arc :: clone ( & self . inner ) ;
244- #[ allow( deprecated) ]
245- Arc :: new ( move |args| captured. invoke ( args) )
246- }
247-
248211 /// Get the circuits of inner implementation
249212 pub fn short_circuits ( & self ) -> bool {
250213 self . inner . short_circuits ( )
@@ -568,47 +531,6 @@ pub trait ScalarUDFImpl: Debug + Send + Sync {
568531 true
569532 }
570533
571- /// Invoke the function on `args`, returning the appropriate result
572- ///
573- /// Note: This method is deprecated and will be removed in future releases.
574- /// User defined functions should implement [`Self::invoke_with_args`] instead.
575- #[ deprecated( since = "42.1.0" , note = "Use `invoke_with_args` instead" ) ]
576- fn invoke ( & self , _args : & [ ColumnarValue ] ) -> Result < ColumnarValue > {
577- not_impl_err ! (
578- "Function {} does not implement invoke but called" ,
579- self . name( )
580- )
581- }
582-
583- /// Invoke the function with `args` and the number of rows,
584- /// returning the appropriate result.
585- ///
586- /// Note: See notes on [`Self::invoke_with_args`]
587- ///
588- /// Note: This method is deprecated and will be removed in future releases.
589- /// User defined functions should implement [`Self::invoke_with_args`] instead.
590- ///
591- /// See <https://github.com/apache/datafusion/issues/13515> for more details.
592- #[ deprecated( since = "46.0.0" , note = "Use `invoke_with_args` instead" ) ]
593- fn invoke_batch (
594- & self ,
595- args : & [ ColumnarValue ] ,
596- number_rows : usize ,
597- ) -> Result < ColumnarValue > {
598- match args. is_empty ( ) {
599- true =>
600- {
601- #[ allow( deprecated) ]
602- self . invoke_no_args ( number_rows)
603- }
604- false =>
605- {
606- #[ allow( deprecated) ]
607- self . invoke ( args)
608- }
609- }
610- }
611-
612534 /// Invoke the function returning the appropriate result.
613535 ///
614536 /// # Performance
@@ -619,23 +541,7 @@ pub trait ScalarUDFImpl: Debug + Send + Sync {
619541 ///
620542 /// [`ColumnarValue::values_to_arrays`] can be used to convert the arguments
621543 /// to arrays, which will likely be simpler code, but be slower.
622- fn invoke_with_args ( & self , args : ScalarFunctionArgs ) -> Result < ColumnarValue > {
623- #[ allow( deprecated) ]
624- self . invoke_batch ( & args. args , args. number_rows )
625- }
626-
627- /// Invoke the function without `args`, instead the number of rows are provided,
628- /// returning the appropriate result.
629- ///
630- /// Note: This method is deprecated and will be removed in future releases.
631- /// User defined functions should implement [`Self::invoke_with_args`] instead.
632- #[ deprecated( since = "42.1.0" , note = "Use `invoke_with_args` instead" ) ]
633- fn invoke_no_args ( & self , _number_rows : usize ) -> Result < ColumnarValue > {
634- not_impl_err ! (
635- "Function {} does not implement invoke_no_args but called" ,
636- self . name( )
637- )
638- }
544+ fn invoke_with_args ( & self , args : ScalarFunctionArgs ) -> Result < ColumnarValue > ;
639545
640546 /// Returns any aliases (alternate names) for this function.
641547 ///
0 commit comments