-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bug in predicate pushdown when multiple predicates have the same …
…root column
- Loading branch information
Showing
9 changed files
with
65 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use super::*; | ||
|
||
#[test] | ||
fn test_foo() -> Result<()> { | ||
let mut expr_arena = Arena::with_capacity(16); | ||
let mut lp_arena = Arena::with_capacity(8); | ||
|
||
let lf = scan_foods_parquet(false).select([col("calories").alias("bar")]); | ||
|
||
// this produces a predicate with two root columns, this test if we can | ||
// deal with multiple roots | ||
let lf = lf.filter(col("bar").gt(lit(45i32))); | ||
let lf = lf.filter(col("bar").lt(lit(110i32))); | ||
|
||
// also check if all predicates are combined and pushed down | ||
let root = lf.optimize(&mut lp_arena, &mut expr_arena)?; | ||
assert!(predicate_at_scan(&mut lp_arena, root)); | ||
// and that we don't have any filter node | ||
assert!(!(&lp_arena) | ||
.iter(root) | ||
.any(|(_, lp)| matches!(lp, ALogicalPlan::Selection { .. }))); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters