()
| 983 | |
| 984 | #[test] |
| 985 | fn test_inlist_nullability() { |
| 986 | let get_schema = |nullable| { |
| 987 | MockExprSchema::new() |
| 988 | .with_data_type(DataType::Int32) |
| 989 | .with_nullable(nullable) |
| 990 | }; |
| 991 | |
| 992 | let expr = col("foo").in_list(vec![lit(1); 5], false); |
| 993 | assert!(!expr.nullable(&get_schema(false)).unwrap()); |
| 994 | assert!(expr.nullable(&get_schema(true)).unwrap()); |
| 995 | // Testing nullable() returns an error. |
| 996 | assert!( |
| 997 | expr.nullable(&get_schema(false).with_error_on_nullable(true)) |
| 998 | .is_err() |
| 999 | ); |
| 1000 | |
| 1001 | let null = lit(ScalarValue::Int32(None)); |
| 1002 | let expr = col("foo").in_list(vec![null, lit(1)], false); |
| 1003 | assert!(expr.nullable(&get_schema(false)).unwrap()); |
| 1004 | |
| 1005 | // Testing on long list |
| 1006 | let expr = col("foo").in_list(vec![lit(1); 6], false); |
| 1007 | assert!(expr.nullable(&get_schema(false)).unwrap()); |
| 1008 | } |
| 1009 | |
| 1010 | #[test] |
| 1011 | fn test_like_nullability() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…