datafusion
datafusion copied to clipboard
fix: derive custom nullable for spark make_interval
Which issue does this PR close?
- Closes #19155.
- Part of #19144
Rationale for this change
What changes are included in this PR?
- Spark
make_intervaluse thereturn_field_from_argsfor handling nullability better - Unit tests to confirm this change
Are these changes tested?
- Added new unit tests, the previous tests pass
Are there any user-facing changes?
Right. I’ll update return_field_from_args to always mark the result nullable (matching Spark’s nullable behavior), and adjust the nullability test accordingly.
@martin-g If we change the return-field policy to “always nullable” , the old comments about zero-arg/non-nullable outputs becomes incorrect, should I change that too?
Good point! Then it should be non-nullable for zero-arg and nullable for the other cases.