Repository navigation
GH-1540: Bind TIMESTAMP parameters in the vector unit and accept java.time values in Flight SQL JDBC - #53
Merged
xxlaykxx merged 1 commit intoDec 3, 2026
Conversation
…t java.time values in Flight SQL JDBC (apache#51) * apacheGH-1540: Bind TIMESTAMP parameters in the vector unit and accept java.time values Convert TIMESTAMP parameter values in the Flight SQL JDBC driver to the unit of the parameter vector instead of writing milliseconds into every unit, and accept LocalDateTime, Instant, OffsetDateTime and ZonedDateTime at full precision. Closes apache#1540. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> (cherry picked from commit df71acc) * Address review feedback - Write values bound with setLong or setObject(Long) to the timestamp vector unchanged, as before, instead of reading them as milliseconds - Add a test that binds a long to each unit, with and without a time zone Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> (cherry picked from commit adf1b16) * Address review feedback Parse numeric offsets in the time zone of a timestamp vector, and bind values at the lower bound of the vector unit without a false overflow. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> (cherry picked from commit 35c0ae1) --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> (cherry picked from commit c0c9b19)
lriggs
approved these changes
Dec 3, 2026
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.
What's Changed
Cherry-pick of #51 (backport of apache#1542, the fix for apache#1540) 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.TIMESTAMPprepared statement parameters in the Flight SQL JDBC driver were bound with the wrong value unless the parameter was in milliseconds: the epoch-millisecond value from Avatica was written unchanged into second, microsecond and nanosecond vectors.java.timevalues were rejected.The change is in
TimestampAvaticaParameterConverter(flight/flight-sql-jdbc-core):java.sql.Timestampandjava.util.Datevalues are converted to the unit of the parameter vector, for all eight timestamp vector types.java.timevalues.setObjectacceptsLocalDateTime,Instant,OffsetDateTimeandZonedDateTimeat full precision.Instant,OffsetDateTimeandZonedDateTimeare rejected for a parameter without a timezone. A vector timezone given as an offset, such as+03:00, is applied; an unknown timezone name fails withDateTimeException.setLongorsetObject(Long)are written unchanged, as before.ArithmeticExceptioninstead of binding a wrong value.Not changed
setTimestampon a parameter with a timezone still binds the wall-clock time of thejava.sql.Timestamp, not its instant. This matches whatgetTimestampreturns when reading; the reasoning is in the upstream PR.Testing
mvn -pl flight/flight-sql-jdbc-core -am verify): 1232 tests, 0 failures, 3 errors. The 3 errors are TLS connection tests that needtesting/data/flight/cert0.pem; thetestingsubmodule was not checked out locally. The style and static checks pass.🤖 Generated with Claude Code