Interval fields returned as `String`

Open
#580 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
database

Research direction

Start with the linked DuckDB interval testcase and compare how the JDBC driver currently exposes interval fields with the existing DuckDBUserArray, DuckDBMap, and DuckDBUserStruct classes. Done means interval columns return a distinguishable custom type instead of String, allowing integrations to convert the value to their preferred duration representation.

Written by the indexing model from the issue text.

Description

Description

DuckDB supports interval types, but the DuckDB JDBC Driver returns these fields as String. In comparison the PostgreSQL JDBC Driver returns a custom org.postgresql.util.PGInterval instance.

Expectation

This makes the integrations for the DuckDB JDBC Driver problematic in certain situations. I would expect a custom class to be returned similar to the org.duckdb.user.DuckDBUserArray, org.duckdb.user.DuckDBMap, or org.duckdb.user.DuckDBUserStruct classes.

Even if this new class behaves the same as a String instance, using a different class would make it possible for the implementations to convert that to a proper Duration type at the end, or whatever the end-user prefers.

Repro case

https://github.com/raszi/duckdb-interval-testcase

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.