Skip to content

fix(bigquery-jdbc): fix getExportedKeys SQL and add TPC metadata tests - #14062

Closed
keshavdandeva wants to merge 4 commits into
mainfrom
jdbc/add-tpc-tests
Closed

fix(bigquery-jdbc): fix getExportedKeys SQL and add TPC metadata tests#14062
keshavdandeva wants to merge 4 commits into
mainfrom
jdbc/add-tpc-tests

Conversation

@keshavdandeva

Copy link
Copy Markdown
Contributor

b/543942439

Changes

  • DatabaseMetaData_GetExportedKeys.sql: Updated SQL to use `%1$s`.`%2$s`.INFORMATION_SCHEMA.<VIEW>
  • ITTPCBigQueryTest.java: Added testDatabaseMetadataOperationsInTPC() and added null checks for ENDPOINT_URL, UNIVERSE_DOMAIN, and auth environment variables.

Verification

  • Verified ITTPCBigQueryTest#testDatabaseMetadataOperationsInTPC against live TPC project tpczero-system:bigquery-drivers on apis-tpczero.goog

@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 updates the SQL query for retrieving exported keys to correctly use backticks for catalog and schema names, and adds null checks to environment variable validations in the integration tests. Additionally, a new integration test is introduced to verify various database metadata operations. The feedback highlights a potential resource leak where the database connection is not safely closed if an exception is thrown during statement creation, suggesting the use of try-with-resources.

@keshavdandeva
keshavdandeva marked this pull request as ready for review August 13, 2026 00:34
@keshavdandeva
keshavdandeva requested review from a team as code owners August 13, 2026 00:34
@@ -23,6 +23,7 @@

import com.google.cloud.bigquery.jdbc.BigQueryConnection;
import java.sql.Connection;

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.

Actually this file is not used, I need to remove it after validating that there are no unique tests.

We're running regular set of tests in TPC. We should have regular metadata test validating this scenario

@keshavdandeva

Copy link
Copy Markdown
Contributor Author

The getExportedKeys SQL works without this change. The new tests would be redundant as the plan is to delete the ITTPCBigQueryTest.java file and use existing ITs in TPC env. Thus, closing this PR.

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