Skip to content

test(bigquery-jdbc): add IT for PCNT metadata and DefaultDataset delimiters - #14210

Open
keshavdandeva wants to merge 8 commits into
mainfrom
jdbc/add-pcnt-it
Open

test(bigquery-jdbc): add IT for PCNT metadata and DefaultDataset delimiters#14210
keshavdandeva wants to merge 8 commits into
mainfrom
jdbc/add-pcnt-it

Conversation

@keshavdandeva

@keshavdandeva keshavdandeva commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

b/554045509

This PR introduces integration test coverage for PCNT (Project-Catalog-Namespace-Table) metadata and DefaultDataset configurations to support multi-driver verification across standard GCP and TPC environments.

Instead of asserting against static pre-existing tables, these integration tests dynamically provision and tear down isolated PCNT test tables per test class, ensuring self-contained and reproducible test execution.

Changes

1. ITBase.java

  • Configurable PCNT Schema: Added PCNT_SCHEMA with fallback to "bq-drivers-test-warehouse.jdbc_pcnt_test_namespace" and environment variable override support for custom TPC environments.
  • Dynamic Table Lifecycle Helpers: Added setUpPcntTable() and cleanUpPcntTable() to create isolated PCNT tables with sample data (id, name) and safely drop them during teardown.

2. ITConnectionTest.java

  • Dynamic PCNT Table Lifecycle: Dynamically creates and tears down PCNT_CONN_TEST_TABLE_<rand> in @BeforeAll / @AfterAll.
  • testDefaultDatasetColonDelimiter(): Tests 2-tier colon syntax (DefaultDataset=project:dataset) and verifies unqualified query execution against default dataset tables.
  • testPcntDefaultDataset2TierNamespace(): Tests 2-tier Lakehouse namespace syntax (DefaultDataset=warehouse.namespace) and executes unqualified queries against PCNT tables.
  • testPcntDefaultDataset3TierNamespace(): Tests 3-tier PCNT syntax (DefaultDataset=project:warehouse.namespace) and executes unqualified queries against PCNT tables.

3. ITDatabaseMetadataTest.java

  • Dynamic PCNT Table Lifecycle: Dynamically creates and tears down PCNT_METADATA_TEST_TABLE_<rand> in @BeforeAll / @AfterAll.
  • testDatabaseMetadataGetSchemasPcnt(): Verifies DatabaseMetaData.getSchemas() accurately enumerates PCNT schema namespaces with correct TABLE_SCHEM and TABLE_CATALOG.
  • testDatabaseMetadataGetTablesPcnt(): Verifies DatabaseMetaData.getTables() discovers dynamic PCNT tables with table type TABLE.
  • testDatabaseMetadataGetColumnsPcnt(): Verifies DatabaseMetaData.getColumns() accurately extracts column metadata (id, name), types, and ordinal positions.

@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 introduces integration tests to verify connection URL parsing with different delimiters (colon and dot) for default datasets, including three-tier namespaces (PCNT). It also adds tests for database metadata retrieval (schemas, tables, and columns) under the PCNT schema. The review feedback suggests removing a redundant null check on the ResultSet in ITConnectionTest in favor of a more robust assertion, and optimizing ITDatabaseMetadataTest by extracting repeated ResultSet lookups into a local variable.

@keshavdandeva

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 adds integration tests to verify default dataset configurations with colon and dot delimiters, as well as 3-tier namespace (PCNT) support in ITConnectionTest and ITDatabaseMetadataTest. The review feedback suggests extracting duplicated schema and table name constants into a dedicated utility class to prevent tight coupling and duplication across test classes.

@keshavdandeva

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 adds integration tests for BigQuery JDBC connections and database metadata, covering default dataset delimiters and 3-tier namespaces (PCNT). It also refactors PCNT constants into ITBase for shared use. The review feedback correctly identifies that the new tests use JUnit 5 style assertions (with the message as the last argument) instead of JUnit 4 style (with the message as the first argument), which will cause compilation errors in this codebase.

@keshavdandeva
keshavdandeva marked this pull request as ready for review August 28, 2026 20:33
@keshavdandeva
keshavdandeva requested review from a team as code owners August 28, 2026 20:33
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