Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved findings show that lazy table listing bypasses retry and token-refresh handling, while REST metadata changes regress materialized-view and clone filtering and array type and nullability reporting.
5 open issues
What changed in this PR
This PR moves C# GetObjects metadata enumeration from INFORMATION_SCHEMA queries to BigQuery REST APIs, enabling four-part Project.Catalog.Namespace.Table (PCNT) datasets without SQL jobs.
Changes:
- Use table listing and metadata APIs for tables, columns, and constraints, with client-side filtering.
- Accept two-part dataset identifiers while keeping project identifier validation single-segment.
- Extend the mock server and tests for REST enumeration and PCNT datasets.
| File | Description |
|---|---|
| csharp/test/AdbcDrivers.BigQuery.Tests/SearchPatternTests.cs | Update identifier validation cases for two-part datasets. |
| csharp/test/AdbcDrivers.BigQuery.Tests/MockServer/MetadataInjectionTests.cs | Add REST enumeration and PCNT test cases. |
| csharp/test/AdbcDrivers.BigQuery.MockServer/MockRequest.cs | Add a table-list request category. |
| csharp/test/AdbcDrivers.BigQuery.MockServer/BigQueryMockServer.cs | Support table registration and REST table listing. |
| csharp/src/AdbcDrivers.BigQuery/BigQueryConnection.cs | Replace metadata SQL queries with REST calls and update identifier validation. |
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Regression coverage is insufficient: the PCNT and pattern-filter tests can pass without verifying the intended behavior, and the REST foreign-key conversion lacks tests for ordering, referenced metadata, and table scoping.
3 open issues
5 resolved since last review
Review effort: Balanced

Summary
Replaces
INFORMATION_SCHEMASQL queries (TABLES,COLUMNS,TABLE_CONSTRAINTS,KEY_COLUMN_USAGE, andCONSTRAINT_COLUMN_USAGE) inGetObjects(GetTableSchemas,GetColumnSchema, andGetConstraintSchema) withClient.ListTablesandClient.GetTablevia the BigQuery REST API. This enablesGetObjectsto support 4-partProject.Catalog.Namespace.Table(PCNT) datasets, aligns the C# driver with the Go driver implementation, and eliminates per-dataset and per-table SQL queries during metadata enumeration.Changes
INFORMATION_SCHEMA.TABLESinGetTableSchemaswithClient.ListTables(catalog, dbSchema), matchingtableNamePattern(viaPatternToRegEx) andtableTypesclient-side.depth != GetObjectsDepth.Tables, fetch full table metadata once per matching table viaClient.GetTable(catalog, dbSchema, tableName)and pass theBigQueryTableresource toGetColumnSchemaandGetConstraintSchema.GetColumnSchemafromtable.Schema.Fields(TableFieldSchema) andGetConstraintSchemafromtable.Resource.TableConstraints(PrimaryKeyandForeignKeys), removingGetConstraintColumnNamesandGetConstraintsUsage.catalog.namespacedataset identifiers inSanitizeIdentifierwhile enforcing single-segment validation for project/catalog identifiers inSanitizeCatalogIdentifier.tables.listsupport andAddTable(Table)toBigQueryMockServer, and updateMetadataInjectionTestsandSearchPatternTestswith PCNTGetObjectstests.Behavioral Changes from
INFORMATION_SCHEMAGetObjectsnow usestables.listandtables.getREST API calls instead of executing up toINFORMATION_SCHEMASQL queries per dataset.constraint_name:PRIMARY KEYconstraints are unnamed.INFORMATION_SCHEMA.TABLE_CONSTRAINTSsynthesized<table_name>.pk$forconstraint_name, whereas the REST API'sTableConstraints.PrimaryKeyhas noNameproperty. BecauseStandardSchemas.ConstraintSchemarequires a non-null string forconstraint_name,GetConstraintSchemanow populates""(string.Empty) for primary keyconstraint_name.constraint_type("PRIMARY KEY"),constraint_column_names(PrimaryKey.Columns), andconstraint_column_usage(null) remain unchanged.GetConstraintsUsagequeriedINFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE WHERE constraint_name = @constraintNameacross the entire dataset without filtering by table name, which could return rows from other tables in the same dataset if they shared a foreign key name. Readingtable.Resource.TableConstraints.ForeignKeysscopes foreign keys strictly to the current table.remarksandxdbc_is_generatedcolumninGetColumnSchema:remarksnow populatesfield.Description ?? string.Emptyinstead of always hardcoding"".xdbc_is_generatedcolumnis set tofalse(BigQuery does not support generated columns;INFORMATION_SCHEMA.COLUMNS.is_generatedwas always"NEVER").xdbc_type_nameinGetColumnSchema:xdbc_type_namenow reflects the RESTTableFieldSchema.Typestring (e.g.INTEGER,FLOAT,BOOLEAN,RECORD) rather than the GoogleSQLINFORMATION_SCHEMA.COLUMNS.data_typestring (INT64,FLOAT64,BOOL,STRUCT).xdbc_sql_data_type(ToXdbcDataType) handles both naming conventions and produces the same values.tables.listreturns"TABLE"for standard tables, whichGetTableSchemasmaps to"BASE TABLE"to matchINFORMATION_SCHEMA.TABLES(tableTypesfilter accepts either"BASE TABLE"or"TABLE").404 NotFound) or the caller lacks table-level permission (403 Forbidden) duringClient.GetTable, the table is skipped instead of failing the entireGetObjectscall.