Repository navigation
fix(bigquery-jdbc): format RANGE bounds consistently across REST and Arrow - #14807
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the formatting of RANGE data types across the BigQuery JDBC driver by consolidating duplicate formatting logic from various result set and struct classes into a centralized utility method, BigQueryTemporalUtility.formatRange. Feedback on these changes includes a recommendation to check if a FieldValue is null before retrieving its range value to prevent potential exceptions, as well as a suggestion to remove redundant case normalization when parsing range element types.
Neenu1995
approved these changes
Oct 28, 2026
Contributor
|
LGTM, but there may be some dead code to clean up in TypeRegistry. |
keshavdandeva
force-pushed
the
jdbc/fix-range-timestamp-format
branch
from
October 28, 2026 18:09
aecbe3d to
51763c3
Compare
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.
b/570670164
Summary
RANGEvalues were formatted inconsistently depending on element type and read path:RANGE<TIMESTAMP>returned raw epoch seconds:[1767225600.000000, 1798761599.000000)RANGE<DATETIME>used aTseparator:[2026-01-01T00:00:00, ...)STRUCT<RANGE>returned a raw map:{"start":...,"end":...}Fix
Added a single
BigQueryTemporalUtility.formatRangeused by all REST and Arrow read paths (top-level, ARRAY, STRUCT). Each bound now reads exactly likegetStringon its element type:[2026-01-01, 2026-12-31)[2026-01-01 00:00:00.000000, 2026-12-31 23:59:59.000000)[2026-01-01 00:00:00.000000, 2026-12-31 23:59:59.000000)UNBOUNDEDis kept for open bounds.EnableTimestampPicosnow only controls TIMESTAMP fraction digits (6 vs 12) instead of gating formatting altogether.Behaviour change
REST callers parsing the old epoch /
T-separated strings will see the new format.Testing
testRangeDataTypeWithJsonResultSet; addedtestRangeBoundsFormatIdenticallyOnRestAndArrow(REST vs. Arrow parity).