Skip to content

Commit e8914c0

Browse files
UBarneyalamb
andauthored
Update datafusion/physical-optimizer/src/pruning.rs
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
1 parent 44e1468 commit e8914c0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

datafusion/physical-optimizer/src/pruning.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1711,7 +1711,11 @@ fn build_like_match(
17111711
Some(combined)
17121712
}
17131713

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).
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+
//
1716+
// The intuition is that if both `col_min` and `col_max` begin with `const_prefix` that means
1717+
// **all** data in this row group begins with `const_prefix` as well (and therefore the predicate
1718+
// looking for rows that don't begin with `const_prefix` can never be true)
17151719
fn build_not_like_match(
17161720
expr_builder: &mut PruningExpressionBuilder<'_>,
17171721
) -> Result<Arc<dyn PhysicalExpr>> {

0 commit comments

Comments
 (0)