xudong963 commented on code in PR #27732:
URL: https://github.com/apache/datafusion/pull/27732#discussion_r4765119974
##########
datafusion/functions/src/datetime/date_trunc.rs:
##########
@@ -1262,6 +1270,121 @@ fn truncates_in_input_unit(granularity: DatePart, tz:
Option<&Tz>) -> bool {
|| (tz.is_none() && granularity.is_fine_granularity_utc())
}
+/// Whether truncating to `granularity` in the local time of `tz` never
reverses
+/// two instants. Computed once per timezone name.
+fn local_truncation_preserves_order(
+ tz_name: &str,
+ tz: Tz,
+ granularity: DatePart,
+) -> bool {
+ static CACHE: LazyLock<Mutex<HashMap<String, LocalTruncationOrder>>> =
+ LazyLock::new(Default::default);
+ let mut cache = CACHE.lock().unwrap_or_else(PoisonError::into_inner);
Review Comment:
I did it in #27883, after #27883 is merged, we can rebase the PR
https://github.com/apache/datafusion/pull/27883/changes/f9598fb140ac0a926723f1340c56f1a1d8835d44
--
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]