panic: date_bin overflows scaling extreme Time64(Microsecond) source
- Dominant language
- Rust
- Stars
- 9.3k
- Forks
- 2.4k
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 344
Description
### Describe the bug
`date_bin` panics during planning/constant folding when scaling an extreme `Time64(Microsecond)` source value.
### To Reproduce
```sql
EXPLAIN SELECT date_bin(
INTERVAL '1 microsecond',
arrow_cast(9223372036854775807, 'Time64(Microsecond)'),
arrow_cast(0, 'Time64(Microsecond)')
);
```
### Actual behavior
```text
thread 'main' panicked at datafusion/functions/src/datetime/date_bin.rs:669:56:
attempt to multiply with overflow
```
### Expected behavior
Return a DataFusion error for the out-of-range time conversion, not a panic.
Contributor guide
Research direction
Reproduce the EXPLAIN query from the issue, then inspect datafusion/functions/src/datetime/date_bin.rs around line 669 and trace the date_bin constant-folding path. Done means the extreme Time64(Microsecond) input returns a DataFusion error for the out-of-range conversion instead of panicking.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100