refactor(jdbc): migrate Read Path to BigQueryTypeRegistry - #14063
Open
Neenu1995 wants to merge 8 commits into
Open
refactor(jdbc): migrate Read Path to BigQueryTypeRegistry#14063Neenu1995 wants to merge 8 commits into
Neenu1995 wants to merge 8 commits into
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.
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:
BigQueryTemporalUtility.boxTimestamp()to use exactBigDecimalparsing instead ofDouble.parseDouble, preventing sub-microsecond precision drift when reading epoch float strings from the JSON API.LocalDateTimeobjects to UTC insideBigQueryTypeRegistryto ensure timestamps do not incorrectly shift based on the local JVM timezone.Time: Replaced default time extraction withBigQueryTemporalUtility.getLocalMillis()to preserve exact millisecond precision when castingLocalDateTimetojava.sql.Timein the Arrow read path.BigQueryJsonStructTestto enforce standard JDBC behavior by correctly asserting that missing struct fields evaluate tonullrather than falling back to incorrect primitive defaults (e.g.,falseor0).BigQueryJsonArrayOfPrimitivesTestfrom.8202269to.820227to accurately match the exact temporal data being asserted against.