Skip to content

fix(csharp): support standard bulk ingest options - #260

Merged
davidhcoe merged 2 commits into
adbc-drivers:mainfrom
CurtHagenlocher:fix/csharp-bulk-ingest-options
Aug 19, 2026
Merged

fix(csharp): support standard bulk ingest options#260
davidhcoe merged 2 commits into
adbc-drivers:mainfrom
CurtHagenlocher:fix/csharp-bulk-ingest-options

Conversation

@CurtHagenlocher

@CurtHagenlocher CurtHagenlocher commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

What's Changed

  • Route adbc.ingest statement options through the BigQuery bulk ingestion path and handle all standard modes.
  • Execute SQL updates by polling the BigQuery job and reading DML affected rows from job statistics, avoiding result-set retrieval for resultless DDL such as DROP TABLE.

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>

Copilot AI 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.

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, and adbc.ingest.temporary in BigQueryStatement.SetOption, routing ExecuteUpdate() through the bulk ingest path.
  • Special-case DROP TABLE updates 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;
Comment thread csharp/src/AdbcDrivers.BigQuery/BigQueryStatement.cs Outdated
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>
@davidhcoe
davidhcoe merged commit 31dfa11 into adbc-drivers:main Aug 19, 2026
6 checks passed
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