Skip to content

GH-1539: Read and bind TIME values at full precision as wall-clock time in Flight SQL JDBC - #50

Merged
xxlaykxx merged 3 commits into
dremio:dremio_27.0_26_20from
xxlaykxx:GH-1539-dremio_27.0_26_20
Dec 3, 2026
Merged

xxlaykxx merged 3 commits into
dremio:dremio_27.0_26_20from
xxlaykxx:GH-1539-dremio_27.0_26_20

Conversation

@xxlaykxx

@xxlaykxx xxlaykxx commented Dec 1, 2026

Copy link
Copy Markdown

What's Changed

Cherry-pick of apache#1541 (fix for apache#1539) onto dremio_27.0_26_20. The upstream PR is still open, not merged. The pick applied without conflicts.

TIME columns read through the Flight SQL JDBC driver were truncated to milliseconds and shifted by the client JVM timezone, and TIME parameters could not be bound correctly. With the client in Europe/Berlin, 12:34:56.123456 from a Time(MICROSECOND, 64) column was returned as 13:34:56.123.

All changes are in flight/flight-sql-jdbc-core:

  • Reading. ArrowFlightJdbcTimeVectorAccessor builds a LocalTime from the raw vector value. getTime, getObject and getString return wall-clock time in any JVM default timezone, with the full fraction in getString. getObject(i, LocalTime.class) keeps the fraction and returns null on a NULL row instead of throwing NullPointerException.
  • ArrowFlightJdbcTime carries the nanosecond fraction and prints 3, 6 or 9 fractional digits.
  • Binding. TimeAvaticaParameterConverter accepts LocalTime and converts the value to the unit of the parameter vector.

Behaviour change

getTime with no calendar now returns wall-clock time, so code that compensates for the old timezone shift will see a different value. See the upstream PR for the full list of behaviour notes.

Testing

  • The driver tests on this branch (mvn -pl flight/flight-sql-jdbc-core -am verify): 1317 tests, 0 failures, 6 errors. The 6 errors are TLS connection tests that need testing/data/flight/cert0.pem; the testing submodule was not checked out locally. The style and static checks pass.
  • Not tested end to end against a Dremio server.

🤖 Generated with Claude Code

…ock time

Read TIME columns in the Flight SQL JDBC driver as wall-clock time with the
full fraction of the column unit, instead of truncating to milliseconds and
shifting by the client JVM timezone. Accept LocalTime as a parameter and
convert bound TIME values to the unit of the parameter vector.

Closes apache#1539.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit 185b595)
- Format the fraction of ArrowFlightJdbcTime with Locale.ROOT so that it
  does not depend on the JVM default locale
- Add a regression test with an ar-EG default locale

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit 2c3f97e)
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

Thank you for opening a pull request!

Please label the PR with one or more of:

  • bug-fix
  • chore
  • dependencies
  • documentation
  • enhancement

Also, add the 'breaking-change' label if appropriate.

See CONTRIBUTING.md for details.

@xxlaykxx
xxlaykxx requested a review from lriggs December 2, 2026 10:01
Reject ArrowFlightJdbcTime values whose milliseconds and nanoseconds
disagree, and cover the calendar conversion of getTime in a non-UTC
default time zone.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit e72b4de)
@xxlaykxx
xxlaykxx merged commit f10dea1 into dremio:dremio_27.0_26_20 Dec 3, 2026
10 of 11 checks passed
xxlaykxx added a commit that referenced this pull request Dec 3, 2026
…ock time in Flight SQL JDBC (#50) (#52)

* apacheGH-1539: Read and bind TIME values at full precision as wall-clock time

Read TIME columns in the Flight SQL JDBC driver as wall-clock time with the
full fraction of the column unit, instead of truncating to milliseconds and
shifting by the client JVM timezone. Accept LocalTime as a parameter and
convert bound TIME values to the unit of the parameter vector.

Closes apache#1539.


(cherry picked from commit 185b595)

* Address review feedback

- Format the fraction of ArrowFlightJdbcTime with Locale.ROOT so that it
  does not depend on the JVM default locale
- Add a regression test with an ar-EG default locale


(cherry picked from commit 2c3f97e)

* Address review feedback

Reject ArrowFlightJdbcTime values whose milliseconds and nanoseconds
disagree, and cover the calendar conversion of getTime in a non-UTC
default time zone.


(cherry picked from commit e72b4de)

---------


(cherry picked from commit f10dea1)

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants