File tree 11 files changed +33
-38
lines changed
datafusion/functions/src/unicode
11 files changed +33
-38
lines changed Original file line number Diff line number Diff line change @@ -88,12 +88,11 @@ impl ScalarUDFImpl for CharacterLengthFunc {
88
88
utf8_to_int_type ( & arg_types[ 0 ] , "character_length" )
89
89
}
90
90
91
- fn invoke_batch (
91
+ fn invoke_with_args (
92
92
& self ,
93
- args : & [ ColumnarValue ] ,
94
- _number_rows : usize ,
93
+ args : datafusion_expr:: ScalarFunctionArgs ,
95
94
) -> Result < ColumnarValue > {
96
- make_scalar_function ( character_length, vec ! [ ] ) ( args)
95
+ make_scalar_function ( character_length, vec ! [ ] ) ( & args . args )
97
96
}
98
97
99
98
fn aliases ( & self ) -> & [ String ] {
Original file line number Diff line number Diff line change @@ -87,11 +87,11 @@ impl ScalarUDFImpl for InitcapFunc {
87
87
}
88
88
}
89
89
90
- fn invoke_batch (
90
+ fn invoke_with_args (
91
91
& self ,
92
- args : & [ ColumnarValue ] ,
93
- _number_rows : usize ,
92
+ args : datafusion_expr:: ScalarFunctionArgs ,
94
93
) -> Result < ColumnarValue > {
94
+ let args = & args. args ;
95
95
match args[ 0 ] . data_type ( ) {
96
96
DataType :: Utf8 => make_scalar_function ( initcap :: < i32 > , vec ! [ ] ) ( args) ,
97
97
DataType :: LargeUtf8 => make_scalar_function ( initcap :: < i64 > , vec ! [ ] ) ( args) ,
Original file line number Diff line number Diff line change @@ -97,11 +97,11 @@ impl ScalarUDFImpl for LeftFunc {
97
97
utf8_to_str_type ( & arg_types[ 0 ] , "left" )
98
98
}
99
99
100
- fn invoke_batch (
100
+ fn invoke_with_args (
101
101
& self ,
102
- args : & [ ColumnarValue ] ,
103
- _number_rows : usize ,
102
+ args : datafusion_expr:: ScalarFunctionArgs ,
104
103
) -> Result < ColumnarValue > {
104
+ let args = & args. args ;
105
105
match args[ 0 ] . data_type ( ) {
106
106
DataType :: Utf8 | DataType :: Utf8View => {
107
107
make_scalar_function ( left :: < i32 > , vec ! [ ] ) ( args)
Original file line number Diff line number Diff line change @@ -109,11 +109,11 @@ impl ScalarUDFImpl for LPadFunc {
109
109
utf8_to_str_type ( & arg_types[ 0 ] , "lpad" )
110
110
}
111
111
112
- fn invoke_batch (
112
+ fn invoke_with_args (
113
113
& self ,
114
- args : & [ ColumnarValue ] ,
115
- _number_rows : usize ,
114
+ args : datafusion_expr:: ScalarFunctionArgs ,
116
115
) -> Result < ColumnarValue > {
116
+ let args = & args. args ;
117
117
match args[ 0 ] . data_type ( ) {
118
118
Utf8 | Utf8View => make_scalar_function ( lpad :: < i32 > , vec ! [ ] ) ( args) ,
119
119
LargeUtf8 => make_scalar_function ( lpad :: < i64 > , vec ! [ ] ) ( args) ,
Original file line number Diff line number Diff line change @@ -85,11 +85,11 @@ impl ScalarUDFImpl for ReverseFunc {
85
85
utf8_to_str_type ( & arg_types[ 0 ] , "reverse" )
86
86
}
87
87
88
- fn invoke_batch (
88
+ fn invoke_with_args (
89
89
& self ,
90
- args : & [ ColumnarValue ] ,
91
- _number_rows : usize ,
90
+ args : datafusion_expr:: ScalarFunctionArgs ,
92
91
) -> Result < ColumnarValue > {
92
+ let args = & args. args ;
93
93
match args[ 0 ] . data_type ( ) {
94
94
Utf8 | Utf8View => make_scalar_function ( reverse :: < i32 > , vec ! [ ] ) ( args) ,
95
95
LargeUtf8 => make_scalar_function ( reverse :: < i64 > , vec ! [ ] ) ( args) ,
Original file line number Diff line number Diff line change @@ -97,11 +97,11 @@ impl ScalarUDFImpl for RightFunc {
97
97
utf8_to_str_type ( & arg_types[ 0 ] , "right" )
98
98
}
99
99
100
- fn invoke_batch (
100
+ fn invoke_with_args (
101
101
& self ,
102
- args : & [ ColumnarValue ] ,
103
- _number_rows : usize ,
102
+ args : datafusion_expr:: ScalarFunctionArgs ,
104
103
) -> Result < ColumnarValue > {
104
+ let args = & args. args ;
105
105
match args[ 0 ] . data_type ( ) {
106
106
DataType :: Utf8 | DataType :: Utf8View => {
107
107
make_scalar_function ( right :: < i32 > , vec ! [ ] ) ( args)
Original file line number Diff line number Diff line change @@ -108,11 +108,11 @@ impl ScalarUDFImpl for RPadFunc {
108
108
utf8_to_str_type ( & arg_types[ 0 ] , "rpad" )
109
109
}
110
110
111
- fn invoke_batch (
111
+ fn invoke_with_args (
112
112
& self ,
113
- args : & [ ColumnarValue ] ,
114
- _number_rows : usize ,
113
+ args : datafusion_expr:: ScalarFunctionArgs ,
115
114
) -> Result < ColumnarValue > {
115
+ let args = & args. args ;
116
116
match (
117
117
args. len ( ) ,
118
118
args[ 0 ] . data_type ( ) ,
Original file line number Diff line number Diff line change @@ -83,12 +83,11 @@ impl ScalarUDFImpl for StrposFunc {
83
83
utf8_to_int_type ( & arg_types[ 0 ] , "strpos/instr/position" )
84
84
}
85
85
86
- fn invoke_batch (
86
+ fn invoke_with_args (
87
87
& self ,
88
- args : & [ ColumnarValue ] ,
89
- _number_rows : usize ,
88
+ args : datafusion_expr:: ScalarFunctionArgs ,
90
89
) -> Result < ColumnarValue > {
91
- make_scalar_function ( strpos, vec ! [ ] ) ( args)
90
+ make_scalar_function ( strpos, vec ! [ ] ) ( & args . args )
92
91
}
93
92
94
93
fn aliases ( & self ) -> & [ String ] {
Original file line number Diff line number Diff line change @@ -95,12 +95,11 @@ impl ScalarUDFImpl for SubstrFunc {
95
95
Ok ( DataType :: Utf8View )
96
96
}
97
97
98
- fn invoke_batch (
98
+ fn invoke_with_args (
99
99
& self ,
100
- args : & [ ColumnarValue ] ,
101
- _number_rows : usize ,
100
+ args : datafusion_expr:: ScalarFunctionArgs ,
102
101
) -> Result < ColumnarValue > {
103
- make_scalar_function ( substr, vec ! [ ] ) ( args)
102
+ make_scalar_function ( substr, vec ! [ ] ) ( & args . args )
104
103
}
105
104
106
105
fn aliases ( & self ) -> & [ String ] {
Original file line number Diff line number Diff line change @@ -108,12 +108,11 @@ impl ScalarUDFImpl for SubstrIndexFunc {
108
108
utf8_to_str_type ( & arg_types[ 0 ] , "substr_index" )
109
109
}
110
110
111
- fn invoke_batch (
111
+ fn invoke_with_args (
112
112
& self ,
113
- args : & [ ColumnarValue ] ,
114
- _number_rows : usize ,
113
+ args : datafusion_expr:: ScalarFunctionArgs ,
115
114
) -> Result < ColumnarValue > {
116
- make_scalar_function ( substr_index, vec ! [ ] ) ( args)
115
+ make_scalar_function ( substr_index, vec ! [ ] ) ( & args . args )
117
116
}
118
117
119
118
fn aliases ( & self ) -> & [ String ] {
Original file line number Diff line number Diff line change @@ -95,12 +95,11 @@ impl ScalarUDFImpl for TranslateFunc {
95
95
utf8_to_str_type ( & arg_types[ 0 ] , "translate" )
96
96
}
97
97
98
- fn invoke_batch (
98
+ fn invoke_with_args (
99
99
& self ,
100
- args : & [ ColumnarValue ] ,
101
- _number_rows : usize ,
100
+ args : datafusion_expr:: ScalarFunctionArgs ,
102
101
) -> Result < ColumnarValue > {
103
- make_scalar_function ( invoke_translate, vec ! [ ] ) ( args)
102
+ make_scalar_function ( invoke_translate, vec ! [ ] ) ( & args . args )
104
103
}
105
104
106
105
fn documentation ( & self ) -> Option < & Documentation > {
You can’t perform that action at this time.
0 commit comments