@@ -38,6 +38,7 @@ use datafusion_expr::{ColumnarValue, expr_vec_fmt};
3838
3939mod array_static_filter;
4040mod branchless_filter;
41+ mod fixed_size_binary_filter;
4142mod primitive_filter;
4243mod result;
4344mod static_filter;
@@ -3548,6 +3549,38 @@ mod tests {
35483549 ) ;
35493550 }
35503551
3552+ // FixedSizeBinary in_array, FixedSizeBinary and Dictionary needles
3553+ let fsb_in = Arc :: new ( FixedSizeBinaryArray :: try_from_iter (
3554+ [
3555+ [ 1 , 2 , 3 , 4 ] . as_slice ( ) ,
3556+ [ 5 , 6 , 7 , 8 ] . as_slice ( ) ,
3557+ [ 9 , 10 , 11 , 12 ] . as_slice ( ) ,
3558+ ]
3559+ . into_iter ( ) ,
3560+ ) ?) as ArrayRef ;
3561+ let fsb_needle = Arc :: new ( FixedSizeBinaryArray :: try_from_iter (
3562+ [
3563+ [ 1 , 2 , 3 , 4 ] . as_slice ( ) ,
3564+ [ 13 , 14 , 15 , 16 ] . as_slice ( ) ,
3565+ [ 5 , 6 , 7 , 8 ] . as_slice ( ) ,
3566+ ]
3567+ . into_iter ( ) ,
3568+ ) ?) as ArrayRef ;
3569+ assert_eq ! (
3570+ expected,
3571+ eval_in_list_from_array( Arc :: clone( & fsb_needle) , Arc :: clone( & fsb_in) ) ?
3572+ ) ;
3573+ // The dictionary does not reference its second value, so that value
3574+ // must not become a member of the flattened list.
3575+ let dict_fsb_in = Arc :: new ( DictionaryArray :: new (
3576+ Int32Array :: from ( vec ! [ 0 , 2 ] ) ,
3577+ Arc :: clone ( & fsb_in) ,
3578+ ) ) ;
3579+ assert_eq ! (
3580+ BooleanArray :: from( vec![ Some ( true ) , Some ( false ) , Some ( false ) ] ) ,
3581+ eval_in_list_from_array( wrap_in_dict( fsb_needle) , dict_fsb_in) ?
3582+ ) ;
3583+
35513584 // Utf8 (falls through to ArrayStaticFilter)
35523585 let utf8_in = Arc :: new ( StringArray :: from ( vec ! [ "a" , "b" , "c" ] ) ) as ArrayRef ;
35533586 let utf8_needle = Arc :: new ( StringArray :: from ( vec ! [ "a" , "d" , "b" ] ) ) as ArrayRef ;
0 commit comments