bhanreddy1973 opened a new pull request, #19606:
URL: https://github.com/apache/datafusion/pull/19606
## Which issue does this PR close?
Closes #19155
## Rationale for this change
Spark's `make_interval` function needs to properly report output nullability:
- When no arguments: returns a non-null zero interval
- When arguments are provided: output is nullable because:
- NULL input → NULL output
- Arithmetic overflow → NULL output
Currently, `return_type` only reports the data type, not nullability
information.
## What changes are included in this PR?
Added `return_field_from_args` implementation to `SparkMakeInterval`:
- With zero arguments: returns `nullable = false` (always returns 0 interval)
- With any arguments: returns `nullable = true` (null inputs or overflow
possible)
## How are these changes tested?
All existing unit tests pass:
- nulls_propagate_per_row
- error_months_overflow_should_be_null
- error_days_overflow_should_be_null
- error_min_overflow_should_be_null
- error_sec_overflow_should_be_null
- happy_path_all_present_single_row
- negative_components_and_fractional_seconds
- zero_args_returns_zero_seconds
## Are these changes safe?
Yes - this only adds metadata about nullability, doesn't change the actual
function behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]