datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

fix: derive custom nullable for spark make_interval

Open kumarUjjawal opened this issue 1 month ago • 3 comments

Which issue does this PR close?

  • Closes #19155.
  • Part of #19144

Rationale for this change

What changes are included in this PR?

  • Spark make_interval use the return_field_from_args for 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?

kumarUjjawal avatar Dec 10 '25 04:12 kumarUjjawal

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.

kumarUjjawal avatar Dec 10 '25 10:12 kumarUjjawal

@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?

kumarUjjawal avatar Dec 10 '25 11:12 kumarUjjawal

Good point! Then it should be non-nullable for zero-arg and nullable for the other cases.

martin-g avatar Dec 10 '25 11:12 martin-g