@@ -399,7 +399,7 @@ async fn prune_disabled() {
399399// https://github.com/apache/datafusion/issues/9779 bug so that tests pass
400400// if and only if Bloom filters on Int8 and Int16 columns are still buggy.
401401macro_rules! int_tests {
402- ( $bits: expr, $fn_lt: ident, $fn_eq: ident, $fn_scalar_fun_and_eq: ident, $fn_scalar_fun: ident, $fn_complex_expr: ident, $fn_complex_expr_subtract: ident, $fn_eq_in_list: ident, $fn_eq_in_list_2: ident, $fn_eq_in_list_negated: ident) => {
402+ ( $bits: expr, $fn_lt: ident, $fn_eq: ident, $fn_scalar_fun_and_eq: ident, $fn_scalar_fun: ident, $fn_complex_expr: ident, $fn_complex_expr_subtract: ident, $fn_eq_in_list: ident, $fn_eq_in_list_2: ident, $fn_eq_in_list_negated: ident, $fn_eq_any_literal_array : ident ) => {
403403 #[ tokio:: test]
404404 async fn $fn_lt( ) {
405405 RowGroupPruningTest :: new( )
@@ -564,6 +564,25 @@ macro_rules! int_tests {
564564 . test_row_group_prune( )
565565 . await ;
566566 }
567+
568+ // Regression test for https://github.com/apache/datafusion/issues/22073:
569+ // `= ANY([literal])` must still allow Parquet file/row-group pruning,
570+ // the same way `IN (literal)` does.
571+ #[ tokio:: test]
572+ async fn $fn_eq_any_literal_array( ) {
573+ RowGroupPruningTest :: new( )
574+ . with_scenario( Scenario :: Int )
575+ . with_query( & format!( "SELECT * FROM t where i{} = ANY([100])" , $bits) )
576+ . with_expected_errors( Some ( 0 ) )
577+ . with_matched_by_stats( Some ( 0 ) )
578+ . with_pruned_by_stats( Some ( 0 ) )
579+ . with_pruned_files( Some ( 1 ) )
580+ . with_matched_by_bloom_filter( Some ( 0 ) )
581+ . with_pruned_by_bloom_filter( Some ( 0 ) )
582+ . with_expected_rows( 0 )
583+ . test_row_group_prune( )
584+ . await ;
585+ }
567586 } ;
568587}
569588
@@ -578,7 +597,8 @@ int_tests!(
578597 prune_int32_complex_expr_subtract,
579598 prune_int32_eq_in_list,
580599 prune_int32_eq_in_list_2,
581- prune_int32_eq_in_list_negated
600+ prune_int32_eq_in_list_negated,
601+ prune_int32_eq_any_literal_array
582602) ;
583603int_tests ! (
584604 64 ,
@@ -590,7 +610,8 @@ int_tests!(
590610 prune_int64_complex_expr_subtract,
591611 prune_int64_eq_in_list,
592612 prune_int64_eq_in_list_2,
593- prune_int64_eq_in_list_negated
613+ prune_int64_eq_in_list_negated,
614+ prune_int64_eq_any_literal_array
594615) ;
595616
596617// $bits: number of bits of the integer to test (8, 16, 32, 64)
0 commit comments