Skip to content

Commit 234ca84

Browse files
authored
refactor(query): pass timezone by reference to avoid Arc churn (#18998)
- Refactor the timezone plumbing so DateConverter, timestamp arithmetic helpers, JSON/date formatting, and all scalar/window consumers accept &TimeZone; cloning happens only when a jiff API needs ownership. This removes dozens of redundant Arc bumps and keeps behavior identical. - Update every downstream caller (functions, formats, window transforms, system/cloud history tables) to pass references, fixing the prior mismatches and addressing the jiff range clamp sites.
1 parent c95fdeb commit 234ca84

File tree

9 files changed

+185
-232
lines changed

9 files changed

+185
-232
lines changed

src/query/expression/src/types/date.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,6 @@ pub fn string_to_date(
159159

160160
#[inline]
161161
pub fn date_to_string(date: impl AsPrimitive<i64>, tz: &TimeZone) -> impl Display {
162-
let res = date.as_().to_date(tz.clone());
162+
let res = date.as_().to_date(tz);
163163
strtime::format(DATE_FORMAT, res).unwrap()
164164
}

src/query/expression/src/types/timestamp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,6 @@ pub fn string_to_timestamp(
192192

193193
#[inline]
194194
pub fn timestamp_to_string(ts: i64, tz: &TimeZone) -> impl Display {
195-
let zdt = ts.to_timestamp(tz.clone());
195+
let zdt = ts.to_timestamp(tz);
196196
strtime::format(TIMESTAMP_FORMAT, &zdt).unwrap()
197197
}

0 commit comments

Comments
 (0)