xiedeyantu opened a new pull request, #22251: URL: https://github.com/apache/datafusion/pull/22251
## Which issue does this PR close? - Closes #22210 ## Rationale for this change `date_bin` could overflow when subtracting extreme nanosecond timestamps, which could trigger a panic. This fix makes that path return an error instead, so the query safely returns `NULL` rather than crashing. ## What changes are included in this PR? - In date_bin.rs, the nanosecond path now uses `checked_sub` instead of direct subtraction, and returns an `ArrowError::InvalidArgumentError` on overflow. - In date_bin_errors.slt, a regression test was added for an extreme nanosecond timestamp case to verify that overflow returns `NULL` instead of panicking. ## Are these changes tested? - Yes. The new sqllogictest covers the regression scenario and verifies that extreme nanosecond timestamp input returns `NULL`. ## Are there any user-facing changes? - Yes. `date_bin` is now more robust for extreme nanosecond timestamp inputs and will return `NULL` instead of panicking. -- 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]
