Skip to content

Commit

Permalink
rm test
Browse files Browse the repository at this point in the history
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
  • Loading branch information
jayzhan211 authored and appletreeisyellow committed May 20, 2024
1 parent 0250e8c commit b0b1609
Showing 1 changed file with 0 additions and 66 deletions.
66 changes: 0 additions & 66 deletions datafusion/optimizer/src/simplify_expressions/guarantees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,72 +261,6 @@ mod tests {
}
}

#[test]
fn test_inequalities_non_null_bounded() {
let guarantees = vec![
// x ∈ [1, 3] (not null)
(
col("x"),
NullableInterval::NotNull {
values: Interval::make(Some(1_i32), Some(3_i32)).unwrap(),
},
),
// s.y ∈ [1, 3] (not null)
(
col("s").field("y"),
NullableInterval::NotNull {
values: Interval::make(Some(1_i32), Some(3_i32)).unwrap(),
},
),
];

let mut rewriter = GuaranteeRewriter::new(guarantees.iter());

// (original_expr, expected_simplification)
let simplified_cases = &[
(col("x").lt(lit(0)), false),
(col("s").field("y").lt(lit(0)), false),
(col("x").lt_eq(lit(3)), true),
(col("x").gt(lit(3)), false),
(col("x").gt(lit(0)), true),
(col("x").eq(lit(0)), false),
(col("x").not_eq(lit(0)), true),
(col("x").between(lit(0), lit(5)), true),
(col("x").between(lit(5), lit(10)), false),
(col("x").not_between(lit(0), lit(5)), false),
(col("x").not_between(lit(5), lit(10)), true),
(
Expr::BinaryExpr(BinaryExpr {
left: Box::new(col("x")),
op: Operator::IsDistinctFrom,
right: Box::new(lit(ScalarValue::Null)),
}),
true,
),
(
Expr::BinaryExpr(BinaryExpr {
left: Box::new(col("x")),
op: Operator::IsDistinctFrom,
right: Box::new(lit(5)),
}),
true,
),
];

validate_simplified_cases(&mut rewriter, simplified_cases);

let unchanged_cases = &[
col("x").gt(lit(2)),
col("x").lt_eq(lit(2)),
col("x").eq(lit(2)),
col("x").not_eq(lit(2)),
col("x").between(lit(3), lit(5)),
col("x").not_between(lit(3), lit(10)),
];

validate_unchanged_cases(&mut rewriter, unchanged_cases);
}

#[test]
fn test_inequalities_non_null_unbounded() {
let guarantees = vec![
Expand Down

0 comments on commit b0b1609

Please sign in to comment.