Skip to content

Commit d749259

Browse files
committed
wip datetimeparts fixes
Signed-off-by: Joe Isaacs <[email protected]>
1 parent 1427597 commit d749259

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

vortex-duckdb/src/convert/scalar.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,11 @@ impl ToDuckDBScalar for ExtScalar<'_> {
201201
_ => vortex_bail!("cannot have TimeUnit {unit}, so represent a day"),
202202
},
203203
TemporalMetadata::Timestamp(unit, tz) => {
204-
if tz.is_some() {
205-
todo!("timezones to duckdb scalar")
204+
if let Some(tz) = tz {
205+
if tz != "UTC" {
206+
todo!()
207+
}
208+
return Ok(Value::new_timestamp_tz(value()?));
206209
}
207210
match unit {
208211
TimeUnit::Nanoseconds => Ok(Value::new_timestamp_ns(value()?)),

vortex-duckdb/src/duckdb/value.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@ impl Value {
197197
}
198198
}
199199

200+
pub fn new_timestamp_tz(micros: i64) -> Self {
201+
unsafe {
202+
Self::own(cpp::duckdb_create_timestamp_tz(cpp::duckdb_timestamp {
203+
micros,
204+
}))
205+
}
206+
}
207+
200208
pub fn new_timestamp_ns(nanos: i64) -> Self {
201209
unsafe {
202210
Self::own(cpp::duckdb_create_timestamp_ns(cpp::duckdb_timestamp_ns {

0 commit comments

Comments
 (0)