Re: [I] panic: date_trunc overflows converting extreme non-ns timestamps to nanoseconds [datafusion]
xudong963 closed issue #22209: panic: date_trunc overflows converting extreme non-ns timestamps to nanoseconds URL: https://github.com/apache/datafusion/issues/22209 -- 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]
Re: [I] panic: date_trunc overflows converting extreme non-ns timestamps to nanoseconds [datafusion]
xiedeyantu commented on issue #22209: URL: https://github.com/apache/datafusion/issues/22209#issuecomment-4467484392 take -- 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]
[I] panic: date_trunc overflows converting extreme non-ns timestamps to nanoseconds [datafusion]
Dandandan opened a new issue, #22209: URL: https://github.com/apache/datafusion/issues/22209 ### Describe the bug `date_trunc` can panic during planning/constant folding for extreme non-nanosecond timestamps. The value is multiplied while converting to nanoseconds without checking for overflow. ### To Reproduce ```sql EXPLAIN SELECT date_trunc( 'hour', arrow_cast(9223372036854775807, 'Timestamp(Second, None)') ); ``` ### Actual behavior ```text thread 'main' panicked at datafusion/functions/src/datetime/date_trunc.rs:721:47: attempt to multiply with overflow ``` ### Expected behavior Return a planning error for an out-of-range timestamp conversion instead of panicking. ### Notes The panic is reachable from SQL through `arrow_cast` plus `date_trunc`; similar extreme `Timestamp(Millisecond)` or `Timestamp(Microsecond)` values appear to hit the same unchecked scale conversion. -- 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]
