Skip to content

feat(bigquery-jdbc): implement PreparedStatement ParameterMetaData and Calendar date setters#13794

Closed
Neenu1995 wants to merge 19 commits into
mainfrom
ps-part2-metadata
Closed

feat(bigquery-jdbc): implement PreparedStatement ParameterMetaData and Calendar date setters#13794
Neenu1995 wants to merge 19 commits into
mainfrom
ps-part2-metadata

Conversation

@Neenu1995

@Neenu1995 Neenu1995 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

b/535194644

  • ParameterMetaData Support: Implemented BigQueryParameterMetaData (java.sql.ParameterMetaData) to support parameter count, type mappings, nullability, and dynamic parameter modes (IN/OUT/INOUT).
  • PreparedStatement Setters: Added Calendar-aware temporal setters (setDate, setTime, setTimestamp), setObject support for java.time types (LocalDate, LocalTime, LocalDateTime, Instant), and missing setter overloads (setShort, setBytes, setArray, setNull).
  • Unified Timezone Coercions: Centralized Calendar-based temporal conversions in BigQueryTypeCoercionUtility, optimized with java.time APIs for zero-allocation wall-clock field extraction and defensive Calendar cloning.

@Neenu1995
Neenu1995 requested review from a team as code owners July 16, 2026 17:15
@Neenu1995
Neenu1995 changed the base branch from main to ps-part1-setters July 16, 2026 17:16

@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 enhances the BigQuery JDBC driver by implementing missing parameter setter methods in BigQueryPreparedStatement, adding BigQueryParameterMetaData support, and updating type mappings to include SMALLINT, TINYINT, and NULL types. The reviewer correctly identified that the setDate, setTime, and setTimestamp methods with Calendar overloads modify the provided Calendar object in-place, which is an unexpected side effect for callers. It is recommended to clone the Calendar object before performing modifications to ensure the original object remains unchanged.

Base automatically changed from ps-part1-setters to main July 17, 2026 16:33
@Neenu1995

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 implements ParameterMetaData support, adds metadata retrieval for BigQueryPreparedStatement, and introduces support for Java 8 java.time classes alongside timezone-aware conversions using Calendar overloads. The reviewer feedback suggests adding a defensive null check for parameterHandler in BigQueryParameterMetaData to prevent a potential NullPointerException, and optimizing the timezone conversion utility methods by replacing expensive Calendar.getInstance() calls with Java 8 java.time classes.

@Neenu1995
Neenu1995 marked this pull request as draft July 17, 2026 20:21
@Neenu1995 Neenu1995 closed this Jul 17, 2026
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.

1 participant