@@ -1711,7 +1711,7 @@ fn build_like_match(
1711
1711
Some ( combined)
1712
1712
}
1713
1713
1714
- // For predicate `col NOT LIKE 'const_prefix%'`, we rewrite it as `(col_min NOT LIKE 'const_prefix%' OR col_max NOT LIKE 'const_prefix%')`.
1714
+ // For predicate `col NOT LIKE 'const_prefix%'`, we rewrite it as `(col_min NOT LIKE 'const_prefix%' OR col_max NOT LIKE 'const_prefix%')`.
1715
1715
//
1716
1716
// The intuition is that if both `col_min` and `col_max` begin with `const_prefix` that means
1717
1717
// **all** data in this row group begins with `const_prefix` as well (and therefore the predicate
@@ -4224,6 +4224,32 @@ mod tests {
4224
4224
] ;
4225
4225
prune_with_expr ( expr, & schema, & statistics, expected_ret) ;
4226
4226
4227
+ let expr = col ( "s1" ) . not_like ( lit ( "A\u{10ffff} %\u{10ffff} _" ) ) ;
4228
+ #[ rustfmt:: skip]
4229
+ let expected_ret = & [
4230
+ // s1 ["A", "Z"] ==> some rows could pass (must keep)
4231
+ true ,
4232
+ // s1 ["A", "L"] ==> some rows could pass (must keep)
4233
+ true ,
4234
+ // s1 ["N", "Z"] ==> some rows could pass (must keep)
4235
+ true ,
4236
+ // s1 ["M", "M"] ==> some rows could pass (must keep)
4237
+ true ,
4238
+ // s1 [NULL, NULL] ==> unknown (must keep)
4239
+ true ,
4240
+ // s1 ["A", NULL] ==> some rows could pass (must keep)
4241
+ true ,
4242
+ // s1 ["", "A"] ==> some rows could pass (must keep)
4243
+ true ,
4244
+ // s1 ["", ""] ==> some rows could pass (must keep)
4245
+ true ,
4246
+ // s1 ["AB", "A\u{10ffff}\u{10ffff}\u{10ffff}"] ==> some rows could pass (must keep)
4247
+ true ,
4248
+ // s1 ["A\u{10ffff}\u{10ffff}", "A\u{10ffff}\u{10ffff}"] ==> some rows could pass (must keep)
4249
+ true ,
4250
+ ] ;
4251
+ prune_with_expr ( expr, & schema, & statistics, expected_ret) ;
4252
+
4227
4253
let expr = col ( "s1" ) . not_like ( lit ( "A\\ %%" ) ) ;
4228
4254
let statistics = TestStatistics :: new ( ) . with (
4229
4255
"s1" ,
0 commit comments