TIMESTAMP_NS nanoseconds are truncated

Open
#571 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
40/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java, sql
Domain
database

Research direction

Start with the provided Java reproduction and trace DuckDBTimestamp during both parameter binding and value reading for a TIMESTAMP_NS column. Confirm the behavior with a round-trip test using a nanosecond value such as 123456789; done means the full nanosecond component is preserved when writing and reading.

Written by the indexing model from the issue text.

Description

E.g.

java.sql.Timestamp ts = new java.sql.Timestamp(millis);
ts.setNanos(123456789);
ps.setTimestamp(1, ts); // column 1 has type TIMESTAMP_NS

DuckDBTimestamp converts the Timestamp to micros and as result nanosecond part (789 from the example) is not stored.

The same happens on reading the value back

Dominant language
C++
Stars
127
Forks
80
Avg merge
13h 41m
Merged PRs (30d)
44

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from duckdb/duckdb-java

All issues in duckdb/duckdb-java

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.