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

Function test_between_nullability

datafusion/expr/src/expr_schema.rs:830–851  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

828
829 #[test]
830 fn test_between_nullability() {
831 let get_schema = |nullable| {
832 MockExprSchema::new()
833 .with_data_type(DataType::Int32)
834 .with_nullable(nullable)
835 };
836
837 let expr = col("foo").between(lit(1), lit(2));
838 assert!(!expr.nullable(&get_schema(false)).unwrap());
839 assert!(expr.nullable(&get_schema(true)).unwrap());
840
841 let null = lit(ScalarValue::Int32(None));
842
843 let expr = col("foo").between(null.clone(), lit(2));
844 assert!(expr.nullable(&get_schema(false)).unwrap());
845
846 let expr = col("foo").between(lit(1), null.clone());
847 assert!(expr.nullable(&get_schema(false)).unwrap());
848
849 let expr = col("foo").between(null.clone(), null);
850 assert!(expr.nullable(&get_schema(false)).unwrap());
851 }
852
853 fn assert_nullability(expr: &Expr, schema: &dyn ExprSchema, expected: bool) {
854 assert_eq!(

Callers

nothing calls this directly

Calls 7

newFunction · 0.85
with_data_typeMethod · 0.80
betweenMethod · 0.80
colFunction · 0.70
litFunction · 0.70
with_nullableMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…