Skip to content

feat(bigquery-jdbc): standardize parameter handling and calendar defensive copying across statement interfaces - #13805

Merged
Neenu1995 merged 45 commits into
mainfrom
ps-part3-callable
Jul 22, 2026
Merged

feat(bigquery-jdbc): standardize parameter handling and calendar defensive copying across statement interfaces#13805
Neenu1995 merged 45 commits into
mainfrom
ps-part3-callable

Conversation

@Neenu1995

@Neenu1995 Neenu1995 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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.

@Neenu1995
Neenu1995 requested review from a team as code owners July 17, 2026 16:57

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

… and update CallableStatement and ResultSet to delegate to BigQueryTypeCoercionUtility
…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.
@Neenu1995

Copy link
Copy Markdown
Contributor Author

/gemini review

Neenu1995 and others added 16 commits July 17, 2026 13:47
# 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.
@Neenu1995
Neenu1995 changed the base branch from ps-part2-metadata to ps-part2b-temporal-setters July 17, 2026 20:10
Base automatically changed from ps-part2b-temporal-setters to main July 21, 2026 18:20
@Neenu1995
Neenu1995 requested a review from logachev July 21, 2026 18:23
@Neenu1995
Neenu1995 merged commit ccd13eb into main Jul 22, 2026
206 checks passed
@Neenu1995
Neenu1995 deleted the ps-part3-callable branch July 22, 2026 16:29
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants