add-source-datastream-to-spanner
Skill1.3k starsChanged 6 months agoApache-2.0View on GitHub
Guide for implementing a database source connector in the v2/datastream-to-spanner forward migration Dataflow template. Details scope boundaries, prerequisites, connector implementations, registry registrations, unit testing, and smoke testing guidelines.
- Reads credentials
Trending
Quiet since October.about the whole repository
Who's talking about GoogleCloudPlatform/DataflowTemplates
- apache/beam“Enforce binary-only constraints during early requirements cache attempts”GitHub · May 26, 2026 · 1 reactions
- apache/beam“Revert gcsio 3 upgrades”GitHub · May 21, 2026 · 1 reactions
- rsamborski/google-skills“Link Checker Report”GitHub · Oct 2, 2026
- gsbingo17/mongodb-to-new“Faster canonical BSON type discovery for _id”GitHub · Sep 22, 2026
- neo4j/docs-dataflow-connector“docs: update launcher VM phase description”GitHub · Sep 22, 2026
The biggest 5 of 34 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 34
Talked about on GitHub (34 times).
On GitHub · 34
- May 26, 2026Enforce binary-only constraints during early requirements cache attempts — apache/beam1 reaction · 6 comments
- May 21, 2026Revert gcsio 3 upgrades — apache/beam1 reaction · 1 comment
- Oct 2, 2026Link Checker Report — rsamborski/google-skills0 reactions
- Sep 22, 2026Faster canonical BSON type discovery for _id — gsbingo17/mongodb-to-new0 reactions
- Sep 22, 2026docs: update launcher VM phase description — neo4j/docs-dataflow-connector0 reactions · 2 comments
29 more on GitHub
- Jul 7, 2026[Task]: Update mheap version to include Node 24 support — apache/beam0 reactions · 1 comment
- May 8, 2026Enhancing counters for MongoDbToMongoDb template — michaeltle-goog/DataflowTemplates0 reactions
- Apr 24, 2026docs: mention import-spec upgrade — neo4j/docs-dataflow-connector0 reactions · 1 comment
- Jan 30, 2026Spanner is hanging when DCP is enabled — apache/beam0 reactions · 4 comments
- Jan 16, 2026[Bug]: Remove Spanner exclusion once bug is fixed — apache/beam0 reactions · 4 comments
- Jan 16, 2026Fix spanner io hang by closing connections — apache/beam0 reactions · 3 comments
- Jan 15, 2026Pin spanner version, not just spanner bom — apache/beam0 reactions · 2 comments
- Jan 14, 2026Update neo4j resource manager — apache/beam0 reactions · 4 comments
- Jan 14, 2026Revert spanner version — apache/beam0 reactions · 4 comments
- Dec 29, 2025Documentation update on RetryDLQ flow — GoogleCloudPlatform/spanner-migration-tool0 reactions · 1 comment
- Oct 20, 2025Fix BigQueryIO File load validate runtime value provider — apache/beam0 reactions · 2 comments
- Aug 28, 2025update the changes.md for upgrading MongoDB Java driver — apache/beam0 reactions · 1 comment
- Apr 16, 2025[Task]: Add Validates Runner Yaml Suite (or add to existing suites) — apache/beam0 reactions
- Apr 6, 2025Fix flaky test for greedy allocator — SurenSK/alluxio_WLTest0 reactions
- Mar 28, 2025Support Time Partitioned Test Tables in BigqueryResourceManager — apache/beam0 reactions · 3 comments
- Mar 28, 2025[Feature Request]: Support Time Partitioned Test Tables in BigqueryResourceManager — apache/beam0 reactions · 1 comment
- Feb 20, 2025Update SpannerSchema to support postgres tokenlist — apache/beam0 reactions · 2 comments
- Nov 15, 2024[Bug]: Certain nullable type resolved to not null coder after #32705 — apache/beam0 reactions · 8 comments
- Nov 3, 2024Fixing Google DataflowTemplates test — TestingResearchIllinois/idoft0 reactions
- Nov 3, 2024Marking PR opened for DataflowTemplates — TestingResearchIllinois/idoft0 reactions
- Sep 10, 2024Fixed flaky test DataStoreConvertersTest.testCheckSameKey() — mihirgune/DataflowTemplates0 reactions
- Mar 13, 2024[Bug] Annotation processor generated duplicated classes from dependency that also used autovalue — google/auto0 reactions · 3 comments
- Feb 8, 2024[Bug]: DualInputNestedValueProvider is not able to get Value properly if input is RuntimeValueProvider. — apache/beam0 reactions · 4 comments
- Feb 3, 2024[Task]: Reverse it component migration — apache/beam0 reactions · 1 comment
- Oct 27, 2023The project DataflowTemplates can't be parsed when opened by VSCode from WSL — redhat-developer/vscode-java0 reactions
- Aug 20, 2023Increase Elasticsearch wait time from 1 to 2 minutes, make it configurable — testcontainers/testcontainers-java0 reactions · 4 comments
- Jun 5, 2023[Bug]: Possible data loss in BigtableIO r/w if timestamp not set (default to epoch) — apache/beam0 reactions · 8 comments
- Jul 6, 2022Introduce support for RECORD type in TextIOToBigQuery template — chmurakrajowa/OChKDataflowTemplates0 reactions
- Jun 10, 2022Add OutputProject option to PubSubCDC etc. — 1st-penguin/DataflowTemplates0 reactions
In this repository11 other files it gives its agents.
- smt-e2e-dataflow-debuggingSkill
- smt-functional-testingSkill
- add-integ-tests-datastream-to-spannerSkill
- add-integ-tests-gcs-spanner-dvSkill
- add-integ-tests-sourcedb-to-spannerSkill
- add-source-sourcedb-to-spannerSkill
- add-source-datatype-integ-testSkill
- add-source-functional-integ-testSkill
- meta-test-orchestratorSkill
- add-integ-tests-spanner-to-sourcedbSkill
- add-source-spanner-to-sourcedbSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 9 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Datastream Source Compatibility Check: Verify that Google Cloud Datastream natively supports the requested source database type by …
- Distinctive: line 26
Datatype Mapping File: Ask the user to provide or point to the Datatype Mapping Matrix for the new source database, defining the mappings …
- Distinctive: line 27
Test Setup Details: Ask the user for the test environment details required for live smoke testing, including:
- Distinctive: line 35
All implementation for a new source connector MUST be strictly confined to:
- Distinctive: line 54
Verify Datastream Support: Check if the requested source database type is supported by Datastream per Datastream Sources.
- Very specific: line 70
Update corresponding registries and converter files in v2/spanner-common similar to existing sources.
- Very specific: line 78
All unit tests must pass with BUILD SUCCESS.
- Distinctive: line 97
UPDATE: Update existing rows in the source database.
- Distinctive: line 98
DELETE: Delete test rows from the source database.
- Distinctive: line 100
Verify that CDC events flow through Datastream to Cloud Storage and Dataflow.
- Distinctive: line 103
If any CRUD operation fails to replicate or produces data discrepancies in Spanner, inspect error logs, modify the connector and converter …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: Implement Source in Datastream to Spanner Template
Overview
This skill provides a step-by-step procedure for adding support for a new database source connector to the v2/datastream-to-spanner template. It details prerequisites, scope boundaries, type mapping requirements, connector implementation, registry registration, unit testing, and smoke testing procedures.
Prerequisites
[!CRITICAL] MANDATORY PREREQUISITE GATE: Before running code searches, inspecting files, or executing unit tests, you MUST verify if the user provided the inputs below. If any required input is missing, STOP IMMEDIATELY and ask the user for clarification before proceeding further.
- Datastream Source Compatibility Check: Verify that Google Cloud Datastream natively supports the requested source database type by referencing Datastream Supported Sources.
[!CRITICAL]
If the requested source database is NOT supported by Datastream, STOP IMMEDIATELY and inform the user that Datastream does not support CDC streaming for this database source. Do NOT proceed with inspection, implementation, or testing.
- Datatype Mapping File: Ask the user to provide or point to the Datatype Mapping Matrix for the new source database, defining the mappings to Spanner GoogleSQL and PostgreSQL dialects.
- Test Setup Details: Ask the user for the test environment details required for live smoke testing, including:
- Source Database Instance details (host/instance name, database name, and credentials/connection method).
- Target Spanner Instance & Database details.
- Datastream stream / connection profile setup or GCP project information.
Architectural Boundaries & Code Scope
All implementation for a new source connector MUST be strictly confined to:
- Source Connector Package:
v2/datastream-to-spanner/src/main/java/com/google/cloud/teleport/v2/templates/source/<source_type>/- Implementation of
IDsToSpSourceConnector(<Source>DsToSpSourceConnector.java) - Source-specific change event processing classes in package
<source_type>(implemented similar to other existing source connectors in the codebase).
- Implementation of
- Connector Registry:
DatastreamToSpannerSourceConnectorRegistry.java- Dynamic connector registration via
register(new <Source>DsToSpSourceConnector()).
- Dynamic connector registration via
- Shared Core Registries & Configs:
v2/spanner-common- Registries and configuration files in
spanner-common(updated similar to existing sources).
- Registries and configuration files in
Datatype Mapping Matrix Requirements
Consult the Datatype Mapping Matrix provided in the prerequisites to verify correct datatype conversion to Spanner GoogleSQL and PostgreSQL dialects. Ensure proper alignment for character, numeric, temporal, binary, boolean, JSON and any other datatypes as specified in the mapping file.
Step-by-Step Implementation Workflow
Step 0: Mandatory Prerequisite Gate
- Verify Datastream Support: Check if the requested source database type is supported by Datastream per Datastream Sources. If unsupported, STOP IMMEDIATELY and notify the user.
- Verify Inputs: Inspect the request for the required inputs. If the Datatype Mapping Matrix and Test Setup Details are not provided in the user request, DO NOT run any inspection or execution tools. Stop and ask the user for the missing details first.
Step 1: Implement <Source>DsToSpSourceConnector
Implement IDsToSpSourceConnector in com.google.cloud.teleport.v2.templates.source.<source_type>:
- Define CDC metadata key constants required by the source.
- Implement any other methods in this class to work for GoogleSQL and PostgreSQL Spanner dialects similar to other supported sources.
Step 2: Implement Source Processing Classes
Implement remaining source-specific change event context and sequence classes in package com.google.cloud.teleport.v2.templates.source.<source_type> similar to other existing source connectors. Skip the types that are not supported by Datastream. These are mentioned in the type mapping skill.
Step 3: Register Source in Registries & Config Files
- Register connector in
DatastreamToSpannerSourceConnectorRegistry.java:register(new <Source>DsToSpSourceConnector()); - Update corresponding registries and converter files in
v2/spanner-commonsimilar to existing sources.
Step 4: Unit Testing & Verification
Execute Maven unit tests for the template:
mvn test -pl v2/datastream-to-spanner \
-Dtest=<Source>DsToSpSourceConnectorTest,DatastreamToSpannerSourceConnectorRegistryTestAll unit tests must pass with BUILD SUCCESS.
Step 5: Mandatory Live Smoke Testing & Verification
[!CRITICAL] MANDATORY EXECUTION REQUIREMENT: Immediately after unit tests pass, you MUST AUTOMATICALLY PROCEED to execute live end-to-end smoke testing using the test environment details provided in the prerequisites. Do NOT stop, pause, or declare completion after unit testing without running the live smoke tests.
[!IMPORTANT] WORKER MACHINE TYPE DIRECTIVE & FALLBACK RULE: When submitting the Dataflow job for live smoke testing, you MUST explicitly specify a worker machine type of the correct size with at least 4 vCPUs. If
--worker-machine-type(orWORKER_MACHINE_TYPE) is not explicitly specified by the user or.env.testing, you MUST ALWAYS default to--worker-machine-type=n2-standard-4. Omitting this parameter or submittingnull/blank will cause Dataflow job launch validation to fail with a machine specification policy violation.
- Environment Setup:
- Connect to the live source database instance and target Spanner instance configured in the test setup.
- Perform CRUD Operations:
- INSERT: Execute
INSERTstatements covering supported datatypes in the source database. - UPDATE: Update existing rows in the source database.
- DELETE: Delete test rows from the source database.
- INSERT: Execute
- Verify Replication Flow:
- Verify that CDC events flow through Datastream to Cloud Storage and Dataflow.
- Query Cloud Spanner tables to confirm that
INSERT,UPDATE, andDELETEoperations are accurately reflected in Spanner.
- Retry Loop on Failure:
- If any CRUD operation fails to replicate or produces data discrepancies in Spanner, inspect error logs, modify the connector and converter code, rebuild, and re-test until all operations pass cleanly.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

