FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

refactor(bigquery-jdbc): migrate write path and metadata to TypeRegistry by Neenu1995 · Pull Request #14061 · googleapis/google-cloud-java · GitHub

refactor(bigquery-jdbc): migrate write path and metadata to TypeRegistry - #14061

Merged
Neenu1995 merged 6 commits into
mainfrom
jdbc-phase4-registry-integration
Aug 24, 2026
Merged

refactor(bigquery-jdbc): migrate write path and metadata to TypeRegistry#14061
Neenu1995 merged 6 commits into
mainfrom
jdbc-phase4-registry-integration

Conversation

Neenu1995 commented Aug 12, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

b/538177258

This PR executes Part 1 of Phase 4 of the Type Registry consolidation.
It migrates all parameter binding (Write Path) and metadata sizing away from the legacy `BigQueryJdbcTypeMappings` and onto the unified `BigQueryTypeRegistry`.

Changes:

  • Write Path: Re-routed parameter SQL type binding in `BigQueryParameterHandler`, `BigQueryPreparedStatement`, and `BigQueryCallableStatement` to use the registry.
  • Metadata Integration: Migrated `ColumnTypeInfo` metadata map into `BigQueryTypeRegistry`.
  • Metadata Classes: Updated `BigQueryResultSetMetadata`, `BigQueryParameterMetaData`, and `BigQueryDatabaseMetaData` to extract sizes and types exclusively from the registry.

Neenu1995 requested review from a team as code owners August 12, 2026 23:58

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Code Review

This pull request refactors the BigQuery JDBC driver by migrating type mapping logic from BigQueryJdbcTypeMappings to BigQueryTypeRegistry across several classes, including BigQueryCallableStatement, BigQueryParameterMetaData, and BigQueryResultSetMetadata. The review feedback highlights several critical improvement opportunities: correcting misplaced Javadoc comments in BigQueryTypeRegistry, resolving dead code caused by a redundant null check on a primitive return value in BigQueryParameterMetaData, and addressing lossy type conversions where converting to a JDBC type first before mapping to a Java class loses precision for types like GEOGRAPHY or JSON. It is recommended to introduce a direct toJavaClass(StandardSQLTypeName) method to preserve type safety and prevent potential null pointer exceptions.

Copy link
Copy Markdown
Contributor Author

/gemini review

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Code Review

This pull request refactors the BigQuery JDBC driver's type mapping mechanism by migrating from BigQueryJdbcTypeMappings to a centralized BigQueryTypeRegistry. This change affects several classes, including BigQueryCallableStatement, BigQueryParameterMetaData, and BigQueryResultSetMetadata. The review feedback highlights several areas for improvement: first, expanding the JDBC_TO_JAVA_CLASS_MAP to include missing standard JDBC types (such as DECIMAL and CHAR) to prevent runtime exceptions; and second, removing redundant null checks and boxing operations across the codebase, as the newly introduced registry methods either return primitive types or are guaranteed to return non-null values.

return descriptor.getDefaultJavaClass();
/** Returns the JDBC Type constant for a given BigQuery type. */
public static int toJdbcType(StandardSQLTypeName bqType) {
if (bqType == null) return java.sql.Types.OTHER;

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

please avoid using one-line if-return, it is more difficult to read compared to

if (){
  return;
}


/** Returns the exact default Java Class for a given BigQuery type, avoiding lossy mappings. */
public static Class<?> toJavaClass(StandardSQLTypeName bqType) {
if (bqType == null) return String.class;

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Same as above

logachev changed the title refactor(jdbc): migrate write path and metadata to TypeRegistry refactor(bigquery-jdbc): migrate write path and metadata to TypeRegistry Aug 14, 2026
Neenu1995 enabled auto-merge (squash) August 24, 2026 18:09
Neenu1995 merged commit d49acf3 into main Aug 24, 2026
202 checks passed
Neenu1995 deleted the jdbc-phase4-registry-integration branch August 24, 2026 18:30
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL