Repository navigation
GH-1540: Bind TIMESTAMP parameters in the vector unit and accept java.time values in Flight SQL JDBC - #51
Merged
xxlaykxx merged 3 commits intoDec 3, 2026
Conversation
…t 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)
This comment has been minimized.
This comment has been minimized.
- 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)
lriggs
reviewed
Dec 2, 2026
lriggs
previously approved these changes
Dec 2, 2026
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)
akravchukdremio
approved these changes
Dec 3, 2026
xxlaykxx
added a commit
that referenced
this pull request
Dec 3, 2026
…t java.time values in Flight SQL JDBC (#51) (#53) * 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. (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 (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. (cherry picked from commit 35c0ae1) --------- (cherry picked from commit c0c9b19) Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
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 apache#1542 (fix for apache#1540) onto
dremio_27.0_26_20. The upstream PR is still open, not merged. The pick applied without conflicts.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.timevalues.setObjectacceptsLocalDateTime,Instant,OffsetDateTimeandZonedDateTimeat full precision.Instant,OffsetDateTimeandZonedDateTimeare rejected for a parameter without a timezone.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): 1307 tests, 0 failures, 6 errors. The 6 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