fix(csharp): support standard bulk ingest options - #260
Merged
davidhcoe merged 2 commits intoAug 19, 2026
Conversation
Route adbc.ingest statement options through the BigQuery bulk ingestion path and handle all standard modes. Avoid fetching query results after DROP TABLE jobs complete. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CurtHagenlocher
requested review from
birschick-bq and
davidhcoe
as code owners
August 19, 2026 16:23
CurtHagenlocher
requested
a lite review from Copilot
and removed request for
birschick-bq and
davidhcoe
August 19, 2026 16:23
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the C# BigQuery ADBC driver to support bulk ingestion configured via standard adbc.ingest.* statement options (routing them through the existing BigQuery Storage Write API bulk ingest implementation), and to avoid unnecessary query-results requests for DROP TABLE update statements.
Changes:
- Add handling for
adbc.ingest.target_catalog,adbc.ingest.target_db_schema,adbc.ingest.target_table,adbc.ingest.mode, andadbc.ingest.temporaryinBigQueryStatement.SetOption, routingExecuteUpdate()through the bulk ingest path. - Special-case
DROP TABLEupdates to poll the job to completion without calling the query-results endpoint. - Extend the mock server/test suite to count query-results endpoint requests and validate the new behaviors.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| csharp/test/AdbcDrivers.BigQuery.Tests/MockServer/MockServerTests.cs | Adds tests for statement-option bulk ingest modes and ensures DROP TABLE doesn’t fetch query results. |
| csharp/test/AdbcDrivers.BigQuery.MockServer/BigQueryMockServer.cs | Tracks how many times the query-results REST route is requested for assertions. |
| csharp/src/AdbcDrivers.BigQuery/BigQueryStatement.cs | Implements statement-option bulk ingest routing and skips query-results fetch for DROP TABLE updates. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+203
to
+210
| UpdateResult result = statement.ExecuteUpdate(); | ||
|
|
||
| Assert.Equal(3, result.AffectedRows); | ||
| Assert.Empty(mockServer.ExecutedQueries); | ||
| var writeStream = mockServer.WriteService.Streams.Values.Last(); | ||
| Assert.True(writeStream.Finalized); | ||
| Assert.Single(writeStream.RecordBatches); | ||
| } |
Comment on lines
+158
to
+180
| case AdbcOptions.Ingest.Mode: | ||
| _isBulkIngest = true; | ||
| _ingestMode = value switch | ||
| { | ||
| AdbcOptions.IngestMode.Create => BulkIngestMode.Create, | ||
| AdbcOptions.IngestMode.Append => BulkIngestMode.Append, | ||
| AdbcOptions.IngestMode.Replace => BulkIngestMode.Replace, | ||
| AdbcOptions.IngestMode.CreateAppend => BulkIngestMode.CreateAppend, | ||
| _ => throw new AdbcException($"Unsupported bulk ingest mode: {value}", AdbcStatusCode.InvalidArgument), | ||
| }; | ||
| break; | ||
| case AdbcOptions.Ingest.Temporary: | ||
| _isBulkIngest = true; | ||
| switch (value) | ||
| { | ||
| case AdbcOptions.Enabled: | ||
| throw AdbcException.NotImplemented("Temporary table bulk ingest is not supported for BigQuery"); | ||
| case AdbcOptions.Disabled: | ||
| break; | ||
| default: | ||
| throw new AdbcException($"Unsupported value for {AdbcOptions.Ingest.Temporary}: {value}", AdbcStatusCode.InvalidArgument); | ||
| } | ||
| break; |
CurtHagenlocher
commented
Aug 19, 2026
Use the completed job statistics for DML affected rows and avoid parsing SQL to identify resultless DDL. Address review feedback by validating ingest options before changing statement state and selecting newly created mock streams deterministically. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's Changed
DROP TABLE.