Skip to content

Commit 9c6d6ee

Browse files
authored
Fix type of ExecutionOptions::time_zone (#16569)
Previously the field was optional. However, when set to a None value, it would trigger invalid behavior, with `timestamp with time zone` type being parsed as if it was just `timestamp` type.
1 parent 0c30f13 commit 9c6d6ee

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

datafusion/common/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ config_namespace! {
364364
///
365365
/// Some functions, e.g. `EXTRACT(HOUR from SOME_TIME)`, shift the underlying datetime
366366
/// according to this time zone, and then extract the hour
367-
pub time_zone: Option<String>, default = Some("+00:00".into())
367+
pub time_zone: String, default = "+00:00".into()
368368

369369
/// Parquet options
370370
pub parquet: ParquetOptions, default = Default::default()

datafusion/sql/src/planner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
616616
// Timestamp With Time Zone
617617
// INPUT : [SQLDataType] TimestampTz + [Config] Time Zone
618618
// OUTPUT: [ArrowDataType] Timestamp<TimeUnit, Some(Time Zone)>
619-
self.context_provider.options().execution.time_zone.clone()
619+
Some(self.context_provider.options().execution.time_zone.clone())
620620
} else {
621621
// Timestamp Without Time zone
622622
None

0 commit comments

Comments
 (0)