File tree Expand file tree Collapse file tree 11 files changed +33
-38
lines changed
datafusion/functions/src/unicode Expand file tree Collapse file tree 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 {
8888 utf8_to_int_type ( & arg_types[ 0 ] , "character_length" )
8989 }
9090
91- fn invoke_batch (
91+ fn invoke_with_args (
9292 & self ,
93- args : & [ ColumnarValue ] ,
94- _number_rows : usize ,
93+ args : datafusion_expr:: ScalarFunctionArgs ,
9594 ) -> Result < ColumnarValue > {
96- make_scalar_function ( character_length, vec ! [ ] ) ( args)
95+ make_scalar_function ( character_length, vec ! [ ] ) ( & args . args )
9796 }
9897
9998 fn aliases ( & self ) -> & [ String ] {
Original file line number Diff line number Diff line change @@ -87,11 +87,11 @@ impl ScalarUDFImpl for InitcapFunc {
8787 }
8888 }
8989
90- fn invoke_batch (
90+ fn invoke_with_args (
9191 & self ,
92- args : & [ ColumnarValue ] ,
93- _number_rows : usize ,
92+ args : datafusion_expr:: ScalarFunctionArgs ,
9493 ) -> Result < ColumnarValue > {
94+ let args = & args. args ;
9595 match args[ 0 ] . data_type ( ) {
9696 DataType :: Utf8 => make_scalar_function ( initcap :: < i32 > , vec ! [ ] ) ( args) ,
9797 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 {
9797 utf8_to_str_type ( & arg_types[ 0 ] , "left" )
9898 }
9999
100- fn invoke_batch (
100+ fn invoke_with_args (
101101 & self ,
102- args : & [ ColumnarValue ] ,
103- _number_rows : usize ,
102+ args : datafusion_expr:: ScalarFunctionArgs ,
104103 ) -> Result < ColumnarValue > {
104+ let args = & args. args ;
105105 match args[ 0 ] . data_type ( ) {
106106 DataType :: Utf8 | DataType :: Utf8View => {
107107 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 {
109109 utf8_to_str_type ( & arg_types[ 0 ] , "lpad" )
110110 }
111111
112- fn invoke_batch (
112+ fn invoke_with_args (
113113 & self ,
114- args : & [ ColumnarValue ] ,
115- _number_rows : usize ,
114+ args : datafusion_expr:: ScalarFunctionArgs ,
116115 ) -> Result < ColumnarValue > {
116+ let args = & args. args ;
117117 match args[ 0 ] . data_type ( ) {
118118 Utf8 | Utf8View => make_scalar_function ( lpad :: < i32 > , vec ! [ ] ) ( args) ,
119119 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 {
8585 utf8_to_str_type ( & arg_types[ 0 ] , "reverse" )
8686 }
8787
88- fn invoke_batch (
88+ fn invoke_with_args (
8989 & self ,
90- args : & [ ColumnarValue ] ,
91- _number_rows : usize ,
90+ args : datafusion_expr:: ScalarFunctionArgs ,
9291 ) -> Result < ColumnarValue > {
92+ let args = & args. args ;
9393 match args[ 0 ] . data_type ( ) {
9494 Utf8 | Utf8View => make_scalar_function ( reverse :: < i32 > , vec ! [ ] ) ( args) ,
9595 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 {
9797 utf8_to_str_type ( & arg_types[ 0 ] , "right" )
9898 }
9999
100- fn invoke_batch (
100+ fn invoke_with_args (
101101 & self ,
102- args : & [ ColumnarValue ] ,
103- _number_rows : usize ,
102+ args : datafusion_expr:: ScalarFunctionArgs ,
104103 ) -> Result < ColumnarValue > {
104+ let args = & args. args ;
105105 match args[ 0 ] . data_type ( ) {
106106 DataType :: Utf8 | DataType :: Utf8View => {
107107 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 {
108108 utf8_to_str_type ( & arg_types[ 0 ] , "rpad" )
109109 }
110110
111- fn invoke_batch (
111+ fn invoke_with_args (
112112 & self ,
113- args : & [ ColumnarValue ] ,
114- _number_rows : usize ,
113+ args : datafusion_expr:: ScalarFunctionArgs ,
115114 ) -> Result < ColumnarValue > {
115+ let args = & args. args ;
116116 match (
117117 args. len ( ) ,
118118 args[ 0 ] . data_type ( ) ,
Original file line number Diff line number Diff line change @@ -83,12 +83,11 @@ impl ScalarUDFImpl for StrposFunc {
8383 utf8_to_int_type ( & arg_types[ 0 ] , "strpos/instr/position" )
8484 }
8585
86- fn invoke_batch (
86+ fn invoke_with_args (
8787 & self ,
88- args : & [ ColumnarValue ] ,
89- _number_rows : usize ,
88+ args : datafusion_expr:: ScalarFunctionArgs ,
9089 ) -> Result < ColumnarValue > {
91- make_scalar_function ( strpos, vec ! [ ] ) ( args)
90+ make_scalar_function ( strpos, vec ! [ ] ) ( & args . args )
9291 }
9392
9493 fn aliases ( & self ) -> & [ String ] {
Original file line number Diff line number Diff line change @@ -95,12 +95,11 @@ impl ScalarUDFImpl for SubstrFunc {
9595 Ok ( DataType :: Utf8View )
9696 }
9797
98- fn invoke_batch (
98+ fn invoke_with_args (
9999 & self ,
100- args : & [ ColumnarValue ] ,
101- _number_rows : usize ,
100+ args : datafusion_expr:: ScalarFunctionArgs ,
102101 ) -> Result < ColumnarValue > {
103- make_scalar_function ( substr, vec ! [ ] ) ( args)
102+ make_scalar_function ( substr, vec ! [ ] ) ( & args . args )
104103 }
105104
106105 fn aliases ( & self ) -> & [ String ] {
Original file line number Diff line number Diff line change @@ -108,12 +108,11 @@ impl ScalarUDFImpl for SubstrIndexFunc {
108108 utf8_to_str_type ( & arg_types[ 0 ] , "substr_index" )
109109 }
110110
111- fn invoke_batch (
111+ fn invoke_with_args (
112112 & self ,
113- args : & [ ColumnarValue ] ,
114- _number_rows : usize ,
113+ args : datafusion_expr:: ScalarFunctionArgs ,
115114 ) -> Result < ColumnarValue > {
116- make_scalar_function ( substr_index, vec ! [ ] ) ( args)
115+ make_scalar_function ( substr_index, vec ! [ ] ) ( & args . args )
117116 }
118117
119118 fn aliases ( & self ) -> & [ String ] {
You can’t perform that action at this time.
0 commit comments