@@ -23,9 +23,12 @@ use arrow::datatypes::DataType;
23
23
use datafusion_expr:: simplify:: { ExprSimplifyResult , SimplifyInfo } ;
24
24
25
25
use crate :: utils:: make_scalar_function;
26
+ use datafusion_common:: types:: logical_string;
26
27
use datafusion_common:: { internal_err, Result , ScalarValue } ;
27
- use datafusion_expr:: { ColumnarValue , Documentation , Expr , Like } ;
28
- use datafusion_expr:: { ScalarFunctionArgs , ScalarUDFImpl , Signature , Volatility } ;
28
+ use datafusion_expr:: {
29
+ Coercion , ColumnarValue , Documentation , Expr , Like , ScalarFunctionArgs ,
30
+ ScalarUDFImpl , Signature , TypeSignatureClass , Volatility ,
31
+ } ;
29
32
use datafusion_macros:: user_doc;
30
33
31
34
/// Returns true if string starts with prefix.
@@ -64,7 +67,13 @@ impl Default for StartsWithFunc {
64
67
impl StartsWithFunc {
65
68
pub fn new ( ) -> Self {
66
69
Self {
67
- signature : Signature :: string ( 2 , Volatility :: Immutable ) ,
70
+ signature : Signature :: coercible (
71
+ vec ! [
72
+ Coercion :: new_exact( TypeSignatureClass :: Native ( logical_string( ) ) ) ,
73
+ Coercion :: new_exact( TypeSignatureClass :: Native ( logical_string( ) ) ) ,
74
+ ] ,
75
+ Volatility :: Immutable ,
76
+ ) ,
68
77
}
69
78
}
70
79
}
0 commit comments