You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "matthewalex4 (via GitHub)" <gi...@apache.org> on 2026/04/01 09:29:40 UTC

[I] `timestamp_ntz_to_timestamp` panics on ambiguous or non-existent local times (DST transitions) [datafusion-comet]

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: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] `timestamp_ntz_to_timestamp` panics on ambiguous or non-existent local times (DST transitions) [datafusion-comet]

Posted by "parthchandra (via GitHub)" <gi...@apache.org>.
parthchandra closed issue #3864: `timestamp_ntz_to_timestamp` panics on ambiguous or non-existent local times (DST transitions)
URL: https://github.com/apache/datafusion-comet/issues/3864


-- 
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@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org