in crates/iceberg/src/expr/visitors/inclusive_metrics_evaluator.rs [1555:1647]
fn test_integer_not_in() {
let result = InclusiveMetricsEvaluator::eval(
&r#not_in_int("id", &[INT_MIN_VALUE - 25, INT_MIN_VALUE - 24]),
&get_test_file_1(),
true,
)
.unwrap();
assert!(result, "Should read: id below lower bound (5 < 30, 6 < 30)");
let result = InclusiveMetricsEvaluator::eval(
&r#not_in_int("id", &[INT_MIN_VALUE - 2, INT_MIN_VALUE - 1]),
&get_test_file_1(),
true,
)
.unwrap();
assert!(
result,
"Should read: id below lower bound (28 < 30, 29 < 30)"
);
let result = InclusiveMetricsEvaluator::eval(
&r#not_in_int("id", &[INT_MIN_VALUE - 1, INT_MIN_VALUE]),
&get_test_file_1(),
true,
)
.unwrap();
assert!(result, "Should read: id equal to lower bound (30 == 30)");
let result = InclusiveMetricsEvaluator::eval(
&r#not_in_int("id", &[INT_MAX_VALUE - 4, INT_MAX_VALUE - 3]),
&get_test_file_1(),
true,
)
.unwrap();
assert!(
result,
"Should read: id between lower and upper bounds (30 < 75 < 79, 30 < 76 < 79)"
);
let result = InclusiveMetricsEvaluator::eval(
&r#not_in_int("id", &[INT_MAX_VALUE, INT_MAX_VALUE + 1]),
&get_test_file_1(),
true,
)
.unwrap();
assert!(result, "Should read: id equal to upper bound (79 == 79)");
let result = InclusiveMetricsEvaluator::eval(
&r#not_in_int("id", &[INT_MAX_VALUE + 1, INT_MAX_VALUE + 2]),
&get_test_file_1(),
true,
)
.unwrap();
assert!(
result,
"Should read: id above upper bound (80 > 79, 81 > 79)"
);
let result = InclusiveMetricsEvaluator::eval(
&r#not_in_int("id", &[INT_MAX_VALUE + 6, INT_MAX_VALUE + 7]),
&get_test_file_1(),
true,
)
.unwrap();
assert!(
result,
"Should read: id above upper bound (85 > 79, 86 > 79)"
);
let result = InclusiveMetricsEvaluator::eval(
&r#not_in_str("all_nulls", &["abc", "def"]),
&get_test_file_1(),
true,
)
.unwrap();
assert!(result, "Should read: NotIn on all nulls column");
let result = InclusiveMetricsEvaluator::eval(
&r#not_in_str("some_nulls", &["abc", "def"]),
&get_test_file_1(),
true,
)
.unwrap();
assert!(result, "Should read: NotIn on some nulls column");
let result = InclusiveMetricsEvaluator::eval(
&r#not_in_str("no_nulls", &["abc", "def"]),
&get_test_file_1(),
true,
)
.unwrap();
assert!(result, "Should read: NotIn on no nulls column");
}