Skip to content

duckdb: support TIMESTAMP_TZ_NS - #11521

Open
wbeckler wants to merge 2 commits into
vortex-data:developfrom
wbeckler:wbeckler/duckdb-timestamp-tz-ns
Open

wbeckler wants to merge 2 commits into
vortex-data:developfrom
wbeckler:wbeckler/duckdb-timestamp-tz-ns

Conversation

@wbeckler

@wbeckler wbeckler commented Nov 17, 2026 •

Copy link
Copy Markdown

Map Vortex zoned nanosecond timestamp columns to TIMESTAMP_TZ_NS in DuckDB.

Written by Claude Code (Claude Fable 5.2), an AI coding agent, working at my direction.

@myrrc myrrc self-assigned this Nov 23, 2026
@myrrc myrrc added changelog/feature A new feature ext/duckdb Relates to the DuckDB integration labels Nov 23, 2026

@myrrc myrrc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, LGTM sans small changes.

Comment thread vortex-duckdb/src/convert/dtype.rs Outdated

let dtype = DType::Extension(
Timestamp::new_with_tz(
let test_cases = [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're at it, can you please remove this test in favour of an .slt (I see you added one below)?

Comment thread vortex-duckdb/src/convert/scalar.rs Outdated
Comment on lines +310 to +311
/// Converts a zoned timestamp to a `TIMESTAMP_TZ_NS` value if it is in nanoseconds, and otherwise
/// to a `TIMESTAMP_TZ` value, rescaling seconds and milliseconds to microseconds.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this comment

Comment thread vortex-duckdb/src/convert/scalar.rs Outdated
}

#[test]
fn try_from_timestamp_tz_ns_scalar() -> VortexResult<()> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this test in favour of an .slt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please prepend a number to this test, 85_timestamp_tz_ns.slt

@myrrc myrrc added changelog/fix A bug fix and removed changelog/feature A new feature labels Nov 23, 2026
@myrrc

myrrc commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Let's also trim the PR description a bit, my suggestion:

Map Vortex zoned nanosecond timestamp columns to TIMESTAMP_TZ_NS in DuckDB.

wbeckler and others added 2 commits November 24, 2026 00:59
read_vortex failed to bind a file with a zoned nanosecond timestamp
column, and COPY of a TIMESTAMPTZ_NS column failed, because only the
DuckDB-to-Vortex dtype mapping knew the type.

Map zoned nanosecond timestamps to TIMESTAMP_TZ_NS in both directions:
the dtype, scalars (pushed filters, constants, statistics and pushed
aggregates), vectors on the COPY path, and min/max statistics.

Zoned timestamps in seconds or milliseconds still fail to bind, since
DuckDB has no zoned type for them.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SMtfpBcKnfP3CkWWQL6mit
Signed-off-by: William Beckler <wbeckler@gmail.com>
Remove the dtype and scalar unit tests that the SQL logic test covers,
remove a comment, and rename the test to 85_timestamp_tz_ns.slt.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: William Beckler <wbeckler@gmail.com>
@wbeckler
wbeckler force-pushed the wbeckler/duckdb-timestamp-tz-ns branch from 9d392bb to c907fb2 Compare November 24, 2026 06:02

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/fix A bug fix ext/duckdb Relates to the DuckDB integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants