Skip to content

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

Merged
xxlaykxx merged 1 commit into
dremio:dremio_27.0_23_19from
xxlaykxx:GH-1539-dremio_27.0_23_19
Dec 3, 2026
Merged

xxlaykxx merged 1 commit into
dremio:dremio_27.0_23_19from
xxlaykxx:GH-1539-dremio_27.0_23_19

Conversation

@xxlaykxx

@xxlaykxx xxlaykxx commented Dec 3, 2026

Copy link
Copy Markdown

What's Changed

Cherry-pick of #50 (backport of apache#1541, the fix for apache#1539) onto dremio_27.0_23_19. The upstream PR is still open, not merged. The pick applied without conflicts and includes the review fixes made upstream so far.

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, independent of the default locale. Its (milliseconds, nanos) constructor rejects values whose millisecond parts disagree.
  • 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): 1221 tests, 0 failures, 3 errors. The 3 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 in Flight SQL JDBC (apache#50)

* 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.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(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

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(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.

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

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit f10dea1)
@xxlaykxx
xxlaykxx merged commit fa3e20c into dremio:dremio_27.0_23_19 Dec 3, 2026
12 of 13 checks passed
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