@@ -239,6 +239,7 @@ fn array_has_inner_for_array(haystack: &ArrayRef, needle: &ArrayRef) -> Result<A
239239 array_has_dispatch_for_array ( haystack, needle)
240240}
241241
242+ #[ derive( Copy , Clone ) ]
242243enum ArrayWrapper < ' a > {
243244 FixedSizeList ( & ' a arrow:: array:: FixedSizeListArray ) ,
244245 List ( & ' a arrow:: array:: GenericListArray < i32 > ) ,
@@ -317,8 +318,8 @@ impl<'a> ArrayWrapper<'a> {
317318 }
318319}
319320
320- fn array_has_dispatch_for_array (
321- haystack : ArrayWrapper < ' _ > ,
321+ fn array_has_dispatch_for_array < ' a > (
322+ haystack : ArrayWrapper < ' a > ,
322323 needle : & ArrayRef ,
323324) -> Result < ArrayRef > {
324325 let mut boolean_builder = BooleanArray :: builder ( haystack. len ( ) ) ;
@@ -390,8 +391,8 @@ fn array_has_all_inner(args: &[ArrayRef]) -> Result<ArrayRef> {
390391
391392// General row comparison for array_has_all and array_has_any
392393fn general_array_has_for_all_and_any < ' a > (
393- haystack : & ArrayWrapper < ' a > ,
394- needle : & ArrayWrapper < ' a > ,
394+ haystack : ArrayWrapper < ' a > ,
395+ needle : ArrayWrapper < ' a > ,
395396 comparison_type : ComparisonType ,
396397) -> Result < ArrayRef > {
397398 let mut boolean_builder = BooleanArray :: builder ( haystack. len ( ) ) ;
@@ -402,8 +403,8 @@ fn general_array_has_for_all_and_any<'a>(
402403 let arr_values = converter. convert_columns ( & [ arr] ) ?;
403404 let sub_arr_values = converter. convert_columns ( & [ sub_arr] ) ?;
404405 boolean_builder. append_value ( general_array_has_all_and_any_kernel (
405- arr_values,
406- sub_arr_values,
406+ & arr_values,
407+ & sub_arr_values,
407408 comparison_type,
408409 ) ) ;
409410 } else {
@@ -416,8 +417,8 @@ fn general_array_has_for_all_and_any<'a>(
416417
417418// String comparison for array_has_all and array_has_any
418419fn array_has_all_and_any_string_internal < ' a > (
419- haystack : & ArrayWrapper < ' a > ,
420- needle : & ArrayWrapper < ' a > ,
420+ haystack : ArrayWrapper < ' a > ,
421+ needle : ArrayWrapper < ' a > ,
421422 comparison_type : ComparisonType ,
422423) -> Result < ArrayRef > {
423424 let mut boolean_builder = BooleanArray :: builder ( haystack. len ( ) ) ;
@@ -427,8 +428,8 @@ fn array_has_all_and_any_string_internal<'a>(
427428 let haystack_array = string_array_to_vec ( & arr) ;
428429 let needle_array = string_array_to_vec ( & sub_arr) ;
429430 boolean_builder. append_value ( array_has_string_kernel (
430- haystack_array,
431- needle_array,
431+ & haystack_array,
432+ & needle_array,
432433 comparison_type,
433434 ) ) ;
434435 }
@@ -442,8 +443,8 @@ fn array_has_all_and_any_string_internal<'a>(
442443}
443444
444445fn array_has_all_and_any_dispatch < ' a > (
445- haystack : & ArrayWrapper < ' a > ,
446- needle : & ArrayWrapper < ' a > ,
446+ haystack : ArrayWrapper < ' a > ,
447+ needle : ArrayWrapper < ' a > ,
447448 comparison_type : ComparisonType ,
448449) -> Result < ArrayRef > {
449450 if needle. values ( ) . is_empty ( ) {
@@ -468,7 +469,7 @@ fn array_has_all_and_any_inner(
468469) -> Result < ArrayRef > {
469470 let haystack: ArrayWrapper = args[ 0 ] . as_ref ( ) . try_into ( ) ?;
470471 let needle: ArrayWrapper = args[ 1 ] . as_ref ( ) . try_into ( ) ?;
471- array_has_all_and_any_dispatch ( & haystack, & needle, comparison_type)
472+ array_has_all_and_any_dispatch ( haystack, needle, comparison_type)
472473}
473474
474475fn array_has_any_inner ( args : & [ ArrayRef ] ) -> Result < ArrayRef > {
@@ -633,8 +634,8 @@ enum ComparisonType {
633634}
634635
635636fn array_has_string_kernel (
636- haystack : Vec < Option < & str > > ,
637- needle : Vec < Option < & str > > ,
637+ haystack : & [ Option < & str > ] ,
638+ needle : & [ Option < & str > ] ,
638639 comparison_type : ComparisonType ,
639640) -> bool {
640641 match comparison_type {
@@ -650,8 +651,8 @@ fn array_has_string_kernel(
650651}
651652
652653fn general_array_has_all_and_any_kernel (
653- haystack_rows : Rows ,
654- needle_rows : Rows ,
654+ haystack_rows : & Rows ,
655+ needle_rows : & Rows ,
655656 comparison_type : ComparisonType ,
656657) -> bool {
657658 match comparison_type {
0 commit comments