Skip to content

fix(bigquery-jdbc): correct FilterTablesOnDefaultDataset fallback logic#13625

Merged
keshavdandeva merged 2 commits into
mainfrom
jdbc/fix-FilterTablesOnDefaultDataset
Jul 6, 2026
Merged

fix(bigquery-jdbc): correct FilterTablesOnDefaultDataset fallback logic#13625
keshavdandeva merged 2 commits into
mainfrom
jdbc/fix-FilterTablesOnDefaultDataset

Conversation

@keshavdandeva

Copy link
Copy Markdown
Contributor

b/530193573

This PR fixes two compliance issues with how the driver handles JDBC metadata when FilterTablesOnDefaultDataset=1 is enabled:

  1. Updated determineEffectiveCatalogAndSchema to strictly follow the specification matrix.
    • Empty strings ("") no longer incorrectly trigger the fallback.
    • Wildcards ("%") correctly trigger the fallback alongside null.
    • Properly normalize the effectiveCatalog to null, ensuring the driver correctly searches for the specified dataset across all accessible projects rather than incorrectly restricting to the default project.
  2. Moved the .isEmpty() checks in getTables() and getColumns() to the very top of the methods.

@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 metadata retrieval methods in BigQueryDatabaseMetaData.java. In getTables and getColumns, empty checks are now performed on the raw input parameters before determining effective identifiers. Additionally, the logic in determineEffectiveCatalogAndSchema has been updated to use the resolved effective identifiers instead of raw parameters, and effectiveCatalog is set to null (rather than the default project) when the catalog is unspecified. I have no further feedback to provide.

@keshavdandeva keshavdandeva marked this pull request as ready for review July 1, 2026 16:48
@keshavdandeva keshavdandeva requested review from a team as code owners July 1, 2026 16:48
@keshavdandeva keshavdandeva merged commit f7eb23d into main Jul 6, 2026
209 checks passed
@keshavdandeva keshavdandeva deleted the jdbc/fix-FilterTablesOnDefaultDataset branch July 6, 2026 15:47
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