Skip to content

feat: spannertest-changestreams#14381

Open
christogav wants to merge 5 commits intogoogleapis:mainfrom
christogav:spannertest-changestreams
Open

feat: spannertest-changestreams#14381
christogav wants to merge 5 commits intogoogleapis:mainfrom
christogav:spannertest-changestreams

Conversation

@christogav
Copy link
Copy Markdown

Initial implementation thoughts for implementing Change Streams in spannertest. I've tried to implement key features to support in-memory testing of change streams.

…annertest. I've tried to implement key features to support in-memory testing of change streams.
@christogav christogav requested review from a team as code owners April 7, 2026 23:36
@google-cla
Copy link
Copy Markdown

google-cla bot commented Apr 7, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

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 implements change stream support within the spannertest emulator, enabling the creation, alteration, and deletion of change streams via DDL. It introduces mutation logging for all write operations (Insert, Update, Delete, Replace) and implements the READ_ table-valued function (TVF) to allow users to query change records. The changes also include updates to the spansql parser to handle TVF syntax and provide exported Go types for client-side decoding. Feedback identifies a critical bug where unconditional transaction lookups in ExecuteSql would break standard queries, and a logic error in the change stream iterator that could incorrectly merge records from distinct transactions sharing the same commit timestamp.

Comment thread spanner/spannertest/inmem.go
Comment thread spanner/spannertest/db_query.go
@christogav christogav changed the title spannertest-changestreams feat: spannertest-changestreams Apr 7, 2026
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