Describe the bug
Expr::field is broken for ScalarValue::Null
After #10375 merged Expr::field is broken when we try and do it on ScalarValue::Null (in addition to #10565)
If you try to use it, you get an error:
The expression to get an indexed field is only valid for List, Struct, or Map types, got Null
To Reproduce
Add this test to expr_fn
#[test]
fn test_get_field_null() {
evaluate_expr_test(
lit(ScalarValue::Null).field("a"),
vec![
"+------------+",
"| NULL literal",
],
);
}
Fails with:
called Result::unwrap() on an Err value: Plan("The expression to get an indexed field is only valid for List, Struct, or Map types, got Null")
Expected behavior
Result should also be a NULL scalar
Additional context
No response