You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the interval of the date_bin function is 0, the query will hit panic
To Reproduce
Run the queries below in DataFusion CLI
DataFusion CLI v25.0.0
❯ SELECT DATE_BIN(INTERVAL '0 second', TIMESTAMP'2022-08-03 14:38:50Z');
thread 'main' panicked at 'attempt to calculate the remainder with a divisor of zero', /arrow-datafusion/datafusion/physical-expr/src/datetime_expressions.rs:354:34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
❯ SELECT DATE_BIN(INTERVAL '0 day', TIMESTAMP'2022-08-03 14:38:50Z');
thread 'main' panicked at 'attempt to calculate the remainder with a divisor of zero', /arrow-datafusion/datafusion/physical-expr/src/datetime_expressions.rs:354:34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
SELECT
DATE_BIN(INTERVAL '0' minute, time) AStime,
val
FROM (
VALUES
(TIMESTAMP'2021-06-10 17:05:00Z', 0.5),
(TIMESTAMP'2021-06-10 17:19:10Z', 0.3)
) as t (time, val);
thread 'tokio-runtime-worker' panicked at 'attempt to calculate the remainder with a divisor of zero', /arrow-datafusion/datafusion/physical-expr/src/datetime_expressions.rs:354:34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
0 rows inset. Query took 0.012 seconds.
Expected behavior
A normal error message rather than a panic. Something like "interval 0 is not supported in date_bin`
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
If the interval of the
date_bin
function is 0, the query will hit panicTo Reproduce
Run the queries below in DataFusion CLI
Expected behavior
A normal error message rather than a panic. Something like "interval 0 is not supported in date_bin`
Additional context
No response
The text was updated successfully, but these errors were encountered: