You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: datafusion/physical-optimizer/src/pruning.rs
+30-46Lines changed: 30 additions & 46 deletions
Original file line number
Diff line number
Diff line change
@@ -1711,11 +1711,11 @@ fn build_like_match(
1711
1711
Some(combined)
1712
1712
}
1713
1713
1714
-
// For predicate `col NOT LIKE 'foo%'`, we rewrite it as `(col_min NOT LIKE 'foo%' OR col_max NOT LIKE 'foo%')`. If both col_min and col_max have the prefix foo, we skip the entire row group (as we can be certain that all data in this row group has the prefix foo).
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%')`. If both col_min and col_max have the prefix const_prefix, we skip the entire row group (as we can be certain that all data in this row group has the prefix const_prefix).
1715
1715
fnbuild_not_like_match(
1716
1716
expr_builder:&mutPruningExpressionBuilder<'_>,
1717
1717
) -> Result<Arc<dynPhysicalExpr>>{
1718
-
// col NOT LIKE 'prefix%' -> !(col_min LIKE 'prefix%' && col_max LIKE 'prefix%') -> (col_min NOT LIKE 'prefix%' || col_max NOT LIKE 'prefix%')
1718
+
// col NOT LIKE 'const_prefix%' -> !(col_min LIKE 'const_prefix%' && col_max LIKE 'const_prefix%') -> (col_min NOT LIKE 'const_prefix%' || col_max NOT LIKE 'const_prefix%')
1719
1719
1720
1720
let min_column_expr = expr_builder.min_column_expr()?;
1721
1721
let max_column_expr = expr_builder.max_column_expr()?;
@@ -1726,27 +1726,21 @@ fn build_not_like_match(
1726
1726
plan_datafusion_err!("cannot extract literal from NOT LIKE expression")
1727
1727
})?;
1728
1728
1729
-
let chars:Vec<char> = pattern.chars().collect();
1730
-
for i in0..chars.len() - 1{
1731
-
// Check if current char is a wildcard and is not escaped with backslash
0 commit comments