You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "NGA-TRAN (via GitHub)" <gi...@apache.org> on 2023/06/01 15:47:19 UTC
[GitHub] [arrow-datafusion] NGA-TRAN opened a new issue, #6517: Panic on date_bin with interval 0
NGA-TRAN opened a new issue, #6517:
URL: https://github.com/apache/arrow-datafusion/issues/6517
### Describe the bug
If the interval of the `date_bin` function is 0, the query will hit panic
### To Reproduce
Run the queries below in DataFusion CLI
```SQL
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) AS time,
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 in set. 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_
--
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: github-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] NGA-TRAN closed issue #6517: Panic on date_bin with interval 0
Posted by "NGA-TRAN (via GitHub)" <gi...@apache.org>.
NGA-TRAN closed issue #6517: Panic on date_bin with interval 0
URL: https://github.com/apache/arrow-datafusion/issues/6517
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] NGA-TRAN commented on issue #6517: Panic on date_bin with interval 0
Posted by "NGA-TRAN (via GitHub)" <gi...@apache.org>.
NGA-TRAN commented on issue #6517:
URL: https://github.com/apache/arrow-datafusion/issues/6517#issuecomment-1578900320
Close this as the fixed #6522 is merged
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] NGA-TRAN commented on issue #6517: Panic on date_bin with interval 0
Posted by "NGA-TRAN (via GitHub)" <gi...@apache.org>.
NGA-TRAN commented on issue #6517:
URL: https://github.com/apache/arrow-datafusion/issues/6517#issuecomment-1572304678
@alamb I am working on this
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org