feat(bigquery-jdbc): standardize parameter handling and calendar defensive copying across statement interfaces - #13805
Merged
Merged
Conversation
…d Calendar date setters
… CallableStatement
…yParameterMetaData
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
…ryJdbcSqlFeatureNotSupportedException
…nsive copying across statement interfaces
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors parameter handling, metadata retrieval, and null-safety in the BigQuery JDBC driver, including implementing wasNull() tracking, throwing proper exceptions for unsupported features, and preventing caller Calendar mutation. Feedback on the changes highlights a critical, recurring bug in BigQueryCallableStatement where isAssignableFrom checks for Date, Time, and Timestamp are reversed, which would cause runtime ClassCastExceptions when attempting to cast superclasses to subclasses.
…d-java into ps-part2-metadata
… in BigQueryTypeCoercionUtility
… and update CallableStatement and ResultSet to delegate to BigQueryTypeCoercionUtility
…rom BigQueryParameterHandler
…rom BigQueryParameterHandler and delegate directly to BigQueryTypeCoercionUtility
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
Contributor
Author
|
/gemini review |
…rameterHandlerTest to FieldValueTypeBigQueryCoercionUtilityTest
…r in BigQueryTypeCoercionUtility
…r in BigQueryTypeCoercionUtility
…tters and setters
…tement parameter setters
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
…d-java into ps-part3-callable
Neenu1995
changed the base branch from
ps-part2-metadata
to
ps-part2b-temporal-setters
July 17, 2026 20:10
logachev
reviewed
Jul 20, 2026
logachev
approved these changes
Jul 22, 2026
mutianf
pushed a commit
to mutianf/google-cloud-java
that referenced
this pull request
Jul 24, 2026
…nsive copying across statement interfaces (googleapis#13805) b/535194644 * **Hardened CallableStatement Getters**: Replaced reversed `isAssignableFrom` checks with `instanceof`, `Number`/`Date` coercions, and direct delegation to `getObject()`. * **Standardized JDBC Parameter Names**: Updated synthetic parameter names (`arg0`, `arg1`) to standard JDBC names (`parameterIndex`, `parameterName`, `scale`). * **Symmetrical Timezone Coercion**: Centralized `Calendar` timezone conversions using `java.time` APIs across statements and result sets. * **ParameterMetaData & Dynamic Modes**: Added support for dynamic `IN`, `OUT`, and `INOUT` parameter modes in `BigQueryParameterMetaData`. * **PreparedStatement Hardening**: Added defensive copying for `Calendar` setters and replaced silent stubs with explicit unsupported feature exceptions.
mutianf
pushed a commit
to mutianf/google-cloud-java
that referenced
this pull request
Jul 24, 2026
…nsive copying across statement interfaces (googleapis#13805) b/535194644 * **Hardened CallableStatement Getters**: Replaced reversed `isAssignableFrom` checks with `instanceof`, `Number`/`Date` coercions, and direct delegation to `getObject()`. * **Standardized JDBC Parameter Names**: Updated synthetic parameter names (`arg0`, `arg1`) to standard JDBC names (`parameterIndex`, `parameterName`, `scale`). * **Symmetrical Timezone Coercion**: Centralized `Calendar` timezone conversions using `java.time` APIs across statements and result sets. * **ParameterMetaData & Dynamic Modes**: Added support for dynamic `IN`, `OUT`, and `INOUT` parameter modes in `BigQueryParameterMetaData`. * **PreparedStatement Hardening**: Added defensive copying for `Calendar` setters and replaced silent stubs with explicit unsupported feature exceptions.
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/535194644
isAssignableFromchecks withinstanceof,Number/Datecoercions, and direct delegation togetObject().arg0,arg1) to standard JDBC names (parameterIndex,parameterName,scale).Calendartimezone conversions usingjava.timeAPIs across statements and result sets.IN,OUT, andINOUTparameter modes inBigQueryParameterMetaData.Calendarsetters and replaced silent stubs with explicit unsupported feature exceptions.