Skip to content

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

Open
Neenu1995 wants to merge 4 commits into
mainfrom
jdbc-phase4-registry-integration
Open

refactor(jdbc): migrate write path and metadata to TypeRegistry#14061
Neenu1995 wants to merge 4 commits into
mainfrom
jdbc-phase4-registry-integration

Conversation

@Neenu1995

@Neenu1995 Neenu1995 commented Aug 12, 2026

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
Neenu1995 requested review from a team as code owners August 12, 2026 23:58

@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 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.

@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 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.

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