fix: support JDBC driver setTimestamp - #375
Merged
Merged
Conversation
from_binding only converted TIMESTAMP_NTZ, so setTimestamp() failed with a 500 for every timestamp column — the JDBC driver sends it as TIMESTAMP_LTZ and the epoch-nanoseconds string reached duckdb unconverted. TIMESTAMP_TZ needs separate handling because the connector encodes it as '<epoch nanoseconds> <utc offset in minutes + 1440>'. Fixes tekumara#374
tekumara
reviewed
Aug 11, 2026
| cur.execute("select * from example where xint = ?", (1,)) | ||
|
|
||
|
|
||
| def test_server_binding_timestamp_ltz(server: dict) -> None: |
Owner
There was a problem hiding this comment.
@anjeongkyun FYI i've added a integration test to cover this
tekumara
approved these changes
Aug 11, 2026
tekumara
enabled auto-merge (squash)
August 11, 2026 12:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
setTimestamp()failed with a 500 for every timestamp column, becausefrom_bindingonly convertedTIMESTAMP_NTZ. The JDBC driver sendssetTimestampasTIMESTAMP_LTZ, so the epoch-nanoseconds string fell through to theelsebranch and reached duckdb unconverted:TIMESTAMP_TZneeded handling separately — the connector encodes it as<epoch nanoseconds> <utc offset in minutes + 1440>, soint()on the whole value fails.Verified with snowflake-jdbc 3.19.0 against the server:
That's the same instant a real account returns for the same binding —
2025-12-31 17:00:00.000 -0800on a session inAmerica/Los_Angeles— only the rendering timezone differs.setDateandsetTimewere already fine, andsetTimematches real Snowflake including the timezone shift.Fixes #374