MCPcopy Create free account
hub / github.com/apache/datafusion / evaluate_bounds_is

Function evaluate_bounds_is

datafusion/expr/src/predicate_bounds.rs:393–488  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

391
392 #[test]
393 fn evaluate_bounds_is() {
394 let null = lit(ScalarValue::Null);
395 let zero = lit(0);
396 let one = lit(1);
397 let t = lit(true);
398 let f = lit(false);
399 let col = col("col");
400 let nullable_schema = DFSchema::try_from(Schema::new(vec![Field::new(
401 "col",
402 DataType::UInt8,
403 true,
404 )]))
405 .unwrap();
406 let not_nullable_schema = DFSchema::try_from(Schema::new(vec![Field::new(
407 "col",
408 DataType::UInt8,
409 false,
410 )]))
411 .unwrap();
412
413 #[rustfmt::skip]
414 let cases = vec![
415 (is_null(null.clone()), NullableInterval::TRUE),
416 (is_null(one.clone()), NullableInterval::FALSE),
417 (is_null(binary_expr(null.clone(), Eq, null.clone())), NullableInterval::TRUE),
418 (is_not_null(null.clone()), NullableInterval::FALSE),
419 (is_not_null(one.clone()), NullableInterval::TRUE),
420 (is_not_null(binary_expr(null.clone(), Eq, null.clone())), NullableInterval::FALSE),
421 (is_true(null.clone()), NullableInterval::FALSE),
422 (is_true(t.clone()), NullableInterval::TRUE),
423 (is_true(f.clone()), NullableInterval::FALSE),
424 (is_true(zero.clone()), NullableInterval::FALSE),
425 (is_true(one.clone()), NullableInterval::TRUE),
426 (is_true(binary_expr(null.clone(), Eq, null.clone())), NullableInterval::FALSE),
427 (is_not_true(null.clone()), NullableInterval::TRUE),
428 (is_not_true(t.clone()), NullableInterval::FALSE),
429 (is_not_true(f.clone()), NullableInterval::TRUE),
430 (is_not_true(zero.clone()), NullableInterval::TRUE),
431 (is_not_true(one.clone()), NullableInterval::FALSE),
432 (is_not_true(binary_expr(null.clone(), Eq, null.clone())), NullableInterval::TRUE),
433 (is_false(null.clone()), NullableInterval::FALSE),
434 (is_false(t.clone()), NullableInterval::FALSE),
435 (is_false(f.clone()), NullableInterval::TRUE),
436 (is_false(zero.clone()), NullableInterval::TRUE),
437 (is_false(one.clone()), NullableInterval::FALSE),
438 (is_false(binary_expr(null.clone(), Eq, null.clone())), NullableInterval::FALSE),
439 (is_not_false(null.clone()), NullableInterval::TRUE),
440 (is_not_false(t.clone()), NullableInterval::TRUE),
441 (is_not_false(f.clone()), NullableInterval::FALSE),
442 (is_not_false(zero.clone()), NullableInterval::FALSE),
443 (is_not_false(one.clone()), NullableInterval::TRUE),
444 (is_not_false(binary_expr(null.clone(), Eq, null.clone())), NullableInterval::TRUE),
445 (is_unknown(null.clone()), NullableInterval::TRUE),
446 (is_unknown(t.clone()), NullableInterval::FALSE),
447 (is_unknown(f.clone()), NullableInterval::FALSE),
448 (is_unknown(zero.clone()), NullableInterval::FALSE),
449 (is_unknown(one.clone()), NullableInterval::FALSE),
450 (is_unknown(binary_expr(null.clone(), Eq, null.clone())), NullableInterval::TRUE),

Callers

nothing calls this directly

Calls 3

newFunction · 0.85
litFunction · 0.70
colFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…