matthewalex4 opened a new issue, #3864:
URL: https://github.com/apache/datafusion-comet/issues/3864
### Describe the bug
`timestamp_ntz_to_timestamp` panics when a local time is ambiguous or
non-existent due to DST transitions:
- **Non-existent (spring forward):** e.g. `2024-03-31 01:30:00` in
`Europe/London` — this time never occurs as clocks skip from 01:00 → 02:00, so
`LocalResult::None` is returned and `from_local_datetime(...).unwrap()` panics.
- **Ambiguous (fall back):** e.g. `2024-10-27 01:30:00` in `Europe/London` —
this time occurs twice as clocks repeat 01:00 → 02:00, so
`LocalResult::Ambiguous` is returned and `from_local_datetime(...).unwrap()`
panics.
Both the `TimestampMicrosecondType` and `TimestampMillisecondType` branches
are affected.
### Steps to reproduce
```rust
// Non-existent time — spring forward
timestamp_ntz_to_timestamp(array_containing("2024-03-31 01:30:00"),
"Europe/London", None); // panic!
// Ambiguous time — fall back
timestamp_ntz_to_timestamp(array_containing("2024-10-27 01:30:00"),
"Europe/London", None); // panic!
```
### Expected behavior
The function should handle all `LocalResult` variants from
`from_local_datetime(...)` without panicking. For ambiguous times, opt for the
earlier option (consistent with e.g. Apache Spark). For a non-existent time,
treat it like that time shifted an hour before.
### 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: [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]