parthchandra commented on code in PR #4039:
URL: https://github.com/apache/datafusion-comet/pull/4039#discussion_r3134142797
##########
native/spark-expr/src/kernels/temporal.rs:
##########
@@ -153,10 +156,30 @@ where
Ok(())
}
-// Apply the Tz to the Naive Date Time,,convert to UTC, and return as
microseconds in Unix epoch
+// Apply the Tz to the Naive Date Time, convert to UTC, and return as
microseconds in Unix epoch.
+// This function re-interprets the local datetime in the timezone to ensure
the correct DST offset
+// is used for the target date (not the original date's offset). This is
important when truncation
+// changes the date to a different DST period (e.g., from December/PST to
October/PDT).
+//
+// Note: For far-future dates (approximately beyond year 2100), chrono-tz may
not accurately
+// calculate DST transitions, which can result in incorrect offsets. See the
compatibility
+// guide for more information.
#[inline]
fn as_micros_from_unix_epoch_utc(dt: Option<DateTime<Tz>>) -> i64 {
Review Comment:
#4040 is merged. Rebased to make sure tests all pass
--
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]