Skip to content

Add Iceberg CDC to Bigtable streaming YAML template - #4618

Open
aIbrahiim wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
aIbrahiim:iceberg-cdc-to-bigtable
Open

aIbrahiim wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
aIbrahiim:iceberg-cdc-to-bigtable

Conversation

@aIbrahiim

Copy link
Copy Markdown
Contributor
  • Adds Iceberg CDC to Bigtable streaming YAML template
  • ReadFromIcebergCDC with streaming, MapToFields + error handling, WriteToBigTable
  • Drops UPDATE_BEFORE, windows before write, DLQ to GCS JSON
  • IT covers INSERT / UPDATE / DELETE
@aIbrahiim
aIbrahiim requested a review from a team as a code owner November 23, 2026 11:14
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request adds a new Google-provided Dataflow YAML template that enables streaming data synchronization from an Iceberg table to Bigtable. The pipeline captures row-level changes, applies user-defined transformations, and handles errors by routing failed records to Cloud Storage. The implementation includes the necessary metadata, YAML configuration, and integration tests to ensure robust operation.

Highlights

  • New Template Addition: Introduced a new streaming YAML template to sync Iceberg CDC changes to Bigtable.
  • Data Transformation & Error Handling: Implemented MapToFields for mutation conversion, added support for dropping UPDATE_BEFORE records, and configured dead-letter queue (DLQ) output to GCS for transformation errors.
  • Integration Testing: Added a comprehensive integration test (IcebergCdcToBigtableYamlIT) covering INSERT, UPDATE, and DELETE operations.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces the Iceberg_Cdc_To_Bigtable_Yaml template, a streaming pipeline that reads row-level changes from an Iceberg table, processes them, and writes mutations to Bigtable, with errors routed to Cloud Storage. The changes include the template's Java interface, YAML definition, documentation, and integration tests. Feedback on the integration test suggests replacing exact equality checks (==) with greater-than-or-equal-to comparisons (>=) in the polling conditions to prevent potential test hangs if the row count exceeds the target.

@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.79%. Comparing base (d187e32) to head (3d78022).
⚠️ Report is 33 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (d187e32) and HEAD (3d78022). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (d187e32) HEAD (3d78022)
5 1
Additional details and impacted files
@@              Coverage Diff              @@
##               main    #4618       +/-   ##
=============================================
- Coverage     59.74%   37.79%   -21.96%     
+ Complexity     8383      521     -7862     
=============================================
  Files          1123      197      -926     
  Lines         72705    12031    -60674     
  Branches       8842     1238     -7604     
=============================================
- Hits          43441     4547    -38894     
+ Misses        26363     7110    -19253     
+ Partials       2901      374     -2527     
Components Coverage Δ
spanner-templates ∅ <ø> (∅)
spanner-import-export ∅ <ø> (∅)
spanner-live-forward-migration ∅ <ø> (∅)
spanner-live-reverse-replication ∅ <ø> (∅)
spanner-bulk-migration ∅ <ø> (∅)
gcs-spanner-dv ∅ <ø> (∅)
see 954 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@derrickaw derrickaw added the addition New feature or request label Nov 23, 2026
@Amar3tto
Amar3tto requested a review from derrickaw November 24, 2026 09:18
@derrickaw

Copy link
Copy Markdown
Contributor

Hi @aIbrahiim, can you address the gemini review comments and the test failure? Thanks

@derrickaw

Copy link
Copy Markdown
Contributor

/gemini review

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces the new Iceberg CDC to Bigtable (YAML) streaming template, including its metadata interface, YAML pipeline definition, documentation, and integration tests. The review feedback highlights syntax errors in the YAML template where Java-style array syntax was used instead of standard YAML sequences for filesToCopy and requirements. Additionally, it is recommended to add @Default annotations to the optional parameters startingStrategy and pollIntervalSeconds in the Java interface to match their documented default values.

Comment on lines +120 to +128
@TemplateParameter.Text(
order = 8,
name = "startingStrategy",
optional = true,
description = "The starting strategy of the changelog read.",
helpText =
"Where to start reading changes from. Valid values are 'earliest' and 'latest'. Defaults to 'latest' for streaming pipelines.",
example = "earliest")
String getStartingStrategy();

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.

medium

Since startingStrategy is an optional parameter with a default value of 'latest' mentioned in the help text, it is highly recommended to add the @Default.String("latest") annotation. This ensures that the getter returns the default value instead of null when the parameter is omitted, preventing potential template compilation or execution issues.

Suggested change
@TemplateParameter.Text(
order = 8,
name = "startingStrategy",
optional = true,
description = "The starting strategy of the changelog read.",
helpText =
"Where to start reading changes from. Valid values are 'earliest' and 'latest'. Defaults to 'latest' for streaming pipelines.",
example = "earliest")
String getStartingStrategy();
@TemplateParameter.Text(
order = 8,
name = "startingStrategy",
optional = true,
description = "The starting strategy of the changelog read.",
helpText =
"Where to start reading changes from. Valid values are 'earliest' and 'latest'. Defaults to 'latest' for streaming pipelines.",
example = "earliest")
@Default.String("latest")
String getStartingStrategy();

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.

seems valid

Comment on lines +130 to +138
@TemplateParameter.Integer(
order = 9,
name = "pollIntervalSeconds",
optional = true,
description = "The interval in seconds at which to poll for new snapshots.",
helpText =
"The interval in seconds at which the source polls the table for new snapshots. Defaults to 60 seconds.",
example = "60")
Integer getPollIntervalSeconds();

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.

medium

Since pollIntervalSeconds is an optional parameter with a default value of 60 mentioned in the help text, it is highly recommended to add the @Default.Integer(60) annotation. This ensures that the getter returns the default value instead of null when the parameter is omitted, preventing potential template compilation or execution issues.

Suggested change
@TemplateParameter.Integer(
order = 9,
name = "pollIntervalSeconds",
optional = true,
description = "The interval in seconds at which to poll for new snapshots.",
helpText =
"The interval in seconds at which the source polls the table for new snapshots. Defaults to 60 seconds.",
example = "60")
Integer getPollIntervalSeconds();
@TemplateParameter.Integer(
order = 9,
name = "pollIntervalSeconds",
optional = true,
description = "The interval in seconds at which to poll for new snapshots.",
helpText =
"The interval in seconds at which the source polls the table for new snapshots. Defaults to 60 seconds.",
example = "60")
@Default.Integer(60)
Integer getPollIntervalSeconds();

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.

seems valid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addition New feature or request size/XL

2 participants