refactor(bigquery-jdbc): migrate Read Path to BigQueryTypeRegistry - #14063
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors type conversion and mapping across the BigQuery JDBC driver by replacing BigQueryTypeCoercer and BigQueryJdbcTypeMappings with BigQueryTypeRegistry. This change requires several methods to declare throwing SQLException. The review feedback suggests keeping the parameter type as FieldValue in BigQueryJsonStruct to avoid redundant downcasts, catching Exception instead of RuntimeException in BigQueryBaseResultSet to properly handle SQLException during conversion, and removing redundant blank lines in BigQueryTypeRegistry.
logachev
approved these changes
Aug 14, 2026
keshavdandeva
approved these changes
Aug 25, 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.
This PR migrates the BigQuery JDBC read-path implementations (Arrow and Json) to utilize the newly introduced
BigQueryTypeRegistryfor unified type lookups and high-performance coercion.Also made the following fixes in implementation and tests:
Type Registry Consolidation & Read-Path Migration
BigQueryTypeCoercerwithBigQueryTypeRegistryas the single source of truth for all type casting and format mapping.BigQueryBaseResultSet,BigQueryArrowResultSet, andBigQueryJsonResultSet(along with their nested Struct and Array counterparts) to funnel allgetObject()and primitive getter calls through the registry.Temporal Type & JDBC 4.2 Spec Compliance
java.sql.Dateto strictly format at UTC midnight, andjava.sql.Timeto1970-01-01in the local JVM, ensuring correct String serialization and civil time preservation.BigQueryJdbcExceptionfor invalid cross-temporal conversions (e.g., blockingjava.sql.Date->java.sql.Timeandjava.sql.Time->java.sql.Date), preserving backward compatibility with legacy strictness.DateTimeFormattercompilations intostatic finalconstants to guarantee fast-path string serialization forTIMESTAMP(6 decimal precision) andTIME(3 decimal precision) without per-row object allocation penalties.Complex Types & Boundary Protection
Integer(days since epoch) andLong(microseconds since epoch) unboxing explicitly inside Arrow structures to bypass global registry mutations, fixing nestedRANGEandARRAYrendering.MAX_VALUE/MIN_VALUEguards) when coercingBigDecimalandLongvalues down to smaller primitives (Integer,Short,Byte) to prevent silent data corruption.