Skip to content

Commit

Permalink
replace CASE expressions in predicate pruning with boolean algebra
Browse files Browse the repository at this point in the history
fix merge

update tests

add some more tests

add some more tests

remove duplicate test case

Update datafusion/physical-optimizer/src/pruning.rs

swap NOT for !=

replace comments, update docstrings

fix example

update tests

update tests

Apply suggestions from code review

Co-authored-by: Andrew Lamb <[email protected]>
  • Loading branch information
2 people authored and appletreeisyellow committed Dec 19, 2024
1 parent ae0a57b commit a4fd860
Show file tree
Hide file tree
Showing 5 changed files with 263 additions and 159 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,7 @@ mod tests {

assert_contains!(
&display,
"pruning_predicate=CASE WHEN c1_null_count@2 = c1_row_count@3 THEN false ELSE c1_min@0 != bar OR bar != c1_max@1 END"
"pruning_predicate=c1_null_count@2 != c1_row_count@3 AND (c1_min@0 != bar OR bar != c1_max@1)"
);

assert_contains!(&display, r#"predicate=c1@0 != bar"#);
Expand Down
Loading

0 comments on commit a4fd860

Please sign in to comment.