这是indexloc提供的服务,不要输入任何密码
Skip to content

Add SQL Server support for Datastream replication events #2498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jsguerrero
Copy link

Description

This PR adds support for SQL Server as a source database in the Datastream-to-SQL template.

Changes

  • Add SQL Server detection using replication_index field in source metadata
  • Implement SQL Server-specific metadata extraction (lsn, tx_id)
  • Update DatastreamRow.getSortFields() to handle SQL Server sorting requirements
  • Add comprehensive tests with SQL Server Avro test data

Testing

  • Unit tests pass successfully (mvn verify)
  • Deployed and tested on Google Cloud Dataflow with real SQL Server Datastream data
  • Integration tests with SQL Server data streams

- Add SQL Server detection using replication_index field in metadata
- Update DatastreamRow.getSortFields() to handle SQL Server sorting fields
- Implement SQL Server metadata extraction in FormatDatastreamRecordToJson
- Add SQL Server test file (sqlserver_test.avro) for validation
- Maintain backward compatibility with MySQL, PostgreSQL, and Oracle sources

SQL Server events from Datastream now properly sort by _metadata_lsn and _metadata_uuid
@jsguerrero jsguerrero requested review from a team as code owners July 2, 2025 16:57
@jsguerrero jsguerrero requested review from darshan-sj and Deep1998 July 2, 2025 16:57
Copy link

google-cla bot commented Jul 2, 2025

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.

@jsguerrero
Copy link
Author

I signed the CLA

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant