Skip to content

feat: Spanner.V1 BatchWrite#15122

Closed
robertvoinescu-work wants to merge 1 commit intogoogleapis:mainfrom
robertvoinescu-work:users/robertvoinescu/spanner-batchwrite
Closed

feat: Spanner.V1 BatchWrite#15122
robertvoinescu-work wants to merge 1 commit intogoogleapis:mainfrom
robertvoinescu-work:users/robertvoinescu/spanner-batchwrite

Conversation

@robertvoinescu-work
Copy link
Copy Markdown
Contributor

@robertvoinescu-work robertvoinescu-work commented Oct 1, 2025

User need access to the BatchWrite API through the Spanner SDK. This is important because BatchWrite allows users to submit a set of bulk mutations in batch for efficient processing. To address this, We introduce a BatchWriteAsync method in PooledSession exposing the API in Spanner.V1.

Details

  • BatchWrite does not exist in a transaction managed by the client - all transaction logic is server side. So, the BatchWriteAsync method avoids transaction management.
  • Integration tests have been added
  • Unit testing has been avoided since the returned type from SpannerClient.BatchWrite, AsyncStream<>, is a sealed class (i.e. cannot be mocked) with no public constructor (i.e. cannot be explicitly created in our tests). We could introduce wrappers to allow for mocking, but that adds a lot of abstraction layers I'm not sure we want.

Non Goals

  • Incorporate spanner into the Spanner ADO layer, this will be handled by another PR.

@robertvoinescu-work robertvoinescu-work requested a review from a team October 1, 2025 19:51
@product-auto-label product-auto-label Bot added the api: spanner Issues related to the Spanner API. label Oct 1, 2025
@robertvoinescu-work robertvoinescu-work marked this pull request as draft October 1, 2025 19:52
@robertvoinescu-work robertvoinescu-work force-pushed the users/robertvoinescu/spanner-batchwrite branch from 4c23ade to f2c5f92 Compare October 1, 2025 19:55
@robertvoinescu-work robertvoinescu-work changed the title Spanner.V1 BatchWrite feat: Spanner.V1 BatchWrite Oct 1, 2025
@robertvoinescu-work robertvoinescu-work force-pushed the users/robertvoinescu/spanner-batchwrite branch 9 times, most recently from 606bdfd to d803b83 Compare October 1, 2025 21:12
@robertvoinescu-work robertvoinescu-work marked this pull request as ready for review October 1, 2025 21:17
Comment thread apis/Google.Cloud.Spanner.V1/Google.Cloud.Spanner.V1/PooledSession.cs Outdated
Comment thread apis/Google.Cloud.Spanner.V1/Google.Cloud.Spanner.V1/PooledSession.cs Outdated
@robertvoinescu-work robertvoinescu-work force-pushed the users/robertvoinescu/spanner-batchwrite branch from d803b83 to a91b1b4 Compare October 6, 2025 21:38
Comment thread apis/Google.Cloud.Spanner.V1/Google.Cloud.Spanner.V1/PooledSession.cs Outdated
@robertvoinescu-work robertvoinescu-work force-pushed the users/robertvoinescu/spanner-batchwrite branch 2 times, most recently from 89082c8 to 0ccf88d Compare October 10, 2025 16:43
Copy link
Copy Markdown
Contributor

@amanda-tarafa amanda-tarafa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left all the comments, but I think we should wait for MUX to implement this, let's chat. I'm marking as do not merge for the time being.

Comment thread apis/Google.Cloud.Spanner.V1/Google.Cloud.Spanner.V1/PooledSession.cs Outdated
Comment thread apis/Google.Cloud.Spanner.V1/Google.Cloud.Spanner.V1/PooledSession.cs Outdated
Comment thread apis/Google.Cloud.Spanner.V1/Google.Cloud.Spanner.V1/PooledSession.cs Outdated
Comment thread apis/Google.Cloud.Spanner.V1/Google.Cloud.Spanner.V1/PooledSession.cs Outdated
Comment thread apis/Google.Cloud.Spanner.V1/Google.Cloud.Spanner.V1/PooledSession.cs Outdated
@amanda-tarafa amanda-tarafa added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Oct 13, 2025
@amanda-tarafa amanda-tarafa marked this pull request as draft November 21, 2025 21:08
@robertvoinescu-work robertvoinescu-work force-pushed the users/robertvoinescu/spanner-batchwrite branch from 0ccf88d to 39f2ccc Compare January 29, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the Spanner API. do not merge Indicates a pull request not ready for merge, due to either quality or timing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants