Skip to content

Commit 820531b

Browse files
authored
Merge pull request #14 from columnar-tech/timezone
fix: render timestamp with time zone data
2 parents 01afd83 + c49f597 commit 820531b

3 files changed

Lines changed: 64 additions & 1 deletion

File tree

Cargo.lock

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ include = ["/src", "/themes", "build.rs", "LICENSE", "README.md"]
1313
[dependencies]
1414
adbc_core = "0.23.0"
1515
adbc_driver_manager = "0.23.0"
16-
arrow = "58.1.0"
16+
arrow = { version = "58.1.0", features = ["chrono-tz"] }
1717
arrow-array = "58.1.0"
1818
arrow-cast = "58.1.0"
1919
arrow-schema = "58.1.0"

tests/integration_test.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,3 +325,31 @@ uri = ":memory:"
325325
let stdout = String::from_utf8_lossy(&output.stdout);
326326
assert!(stdout.contains("profile_options_test"));
327327
}
328+
329+
#[test]
330+
fn test_timestamp_with_time_zone() {
331+
let output = Command::new("cargo")
332+
.args([
333+
"run",
334+
"--",
335+
"--driver",
336+
"duckdb",
337+
"--query",
338+
"SET TimeZone = 'America/Los_Angeles'; SELECT TIMESTAMPTZ '1992-09-20 12:30:00.123456789+01:00'",
339+
])
340+
.output()
341+
.expect("Failed to execute command");
342+
343+
let stderr = String::from_utf8_lossy(&output.stderr);
344+
assert!(
345+
output.status.success(),
346+
"TIMESTAMPTZ query should succeed. stderr: {}",
347+
stderr
348+
);
349+
let stdout = String::from_utf8_lossy(&output.stdout);
350+
assert!(
351+
stdout.contains("1992-09-20T04:30:00.123456-07:00"),
352+
"expected session-zone-rendered TIMESTAMPTZ in output. stdout: {}",
353+
stdout
354+
);
355+
}

0 commit comments

Comments
 (0)