feat(bigquery-jdbc): support picosecond in REST JSON path and nested types - #14334
Open
keshavdandeva wants to merge 1 commit into
Open
feat(bigquery-jdbc): support picosecond in REST JSON path and nested types#14334keshavdandeva wants to merge 1 commit into
keshavdandeva wants to merge 1 commit into
Conversation
keshavdandeva
added this pull request to stack #14335
September 9, 2026 17:52
keshavdandeva
force-pushed
the
jdbc-picosecond-support-4
branch
from
September 9, 2026 17:53
6f586bd to
303b4aa
Compare
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for picosecond timestamp precision and range timestamps within the BigQuery JDBC JSON result sets, arrays, and structs. It adds an "enableTimestampPicos" flag across "BigQueryJsonArray", "BigQueryJsonResultSet", and "BigQueryJsonStruct" to conditionally format timestamps with picosecond precision or format range timestamps when enabled. Helper methods for identifying and formatting these types have been consolidated in "BigQueryTemporalUtility" and "BigQueryJsonResultSet". Comprehensive unit tests have also been added to verify the behavior of these components with the flag both enabled and disabled. I have no feedback to provide.
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/503296051
This PR extends picosecond timestamp precision (
TIMESTAMP(12)) support to the REST JSON query execution path and nested BigQuery data structures (ARRAY,STRUCT,RANGE).Key Changes
Centralized Schema Precision Helper:
BigQueryTemporalUtility.isPicosecondTimestamp(Field)as the single source of truth for scale> 6timestamp fields.BigQueryArrowResultSet.isPicosecondTimestampdirectly to this utility.REST JSON Result Set (
BigQueryJsonResultSet):enableTimestampPicosfrom the parentBigQueryStatement.YYYY-MM-DD HH:MM:SS.SSSSSSSSSSSS).formatRangeTimestamp(FieldValue)helper forRANGE<TIMESTAMP>picosecond formatting, while preserving existingBigQueryTypeRegistryfallthrough for non-pico queries.getObject(int)control flow using early returns and removed redundant defensive index logic.Nested Structures (
BigQueryJsonArray,BigQueryJsonStruct):enableTimestampPicosacross constructors and nested factories.BigQueryJsonArray.getTargetClass()to returnString.classwhen picoseconds are enabled, preventingArray.newInstancetype mismatch crashes.getCoercedValue()andgetValue().Testing & Verification:
BigQueryJsonResultSetTest,BigQueryJsonArrayOfPrimitivesTest, andBigQueryJsonStructTest.enableTimestampPicos=false.