-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Add Iceberg CDC support to YAML #36641
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
Merged
chamikaramj
merged 11 commits into
apache:master
from
tarun-google:iceberg_cdc_blueprint
Nov 19, 2025
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a9c8ac9
Add Iceberg CDC support to YAML and Blueprints
tarun-google 38fe11f
Fix Lint
tarun-google e32ed12
Add Filters to integration test
tarun-google 3b44c3a
Fix Mock Tests
tarun-google e0f8a19
Merge branch 'apache:master' into iceberg_cdc_blueprint
tarun-google 8768fe8
Remove Iceberg Blueprints from Beam Repo
tarun-google 7cb516b
Merge branch 'iceberg_cdc_blueprint' of github.com:tarun-google/beam …
tarun-google 7efe087
Remove mock tests
tarun-google 4ee32d2
Adding timestamps
tarun-google 216afae
Add Streaming test
tarun-google bb0e4bc
Merge branch 'apache:master' into iceberg_cdc_blueprint
tarun-google File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -196,6 +196,23 @@ def shipments_data(): | |
| }] | ||
|
|
||
|
|
||
| def shipment_data_filtered(): | ||
| return [{ | ||
| 'customer_id': 'C1', | ||
| 'shipment_date': '2023-05-01', | ||
| 'shipment_cost': 150.0, | ||
| 'customer_name': 'Alice', | ||
| 'customer_email': '[email protected]' | ||
| }, | ||
| { | ||
| 'customer_id': 'C1', | ||
| 'shipment_date': '2023-05-10', | ||
| 'shipment_cost': 20.0, | ||
| 'customer_name': 'Alice', | ||
| 'customer_email': '[email protected]' | ||
| }] | ||
|
|
||
|
|
||
| def bigtable_data(): | ||
| return [{ | ||
| 'product_id': '1', 'product_name': 'pixel 5', 'product_stock': '2' | ||
|
|
||
62 changes: 62 additions & 0 deletions
62
sdks/python/apache_beam/yaml/examples/transforms/blueprint/iceberg_to_iceberg_batch.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| # coding=utf-8 | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
|
|
||
| # A pipeline that reads records from a Medallion Bronze Iceberg dataset | ||
| # in a batch manner and writes to a Silver Iceberg dataset. | ||
|
|
||
| pipeline: | ||
| type: chain | ||
| transforms: | ||
| # Step 1: Read Records from Iceberg Table within a time range | ||
| - type: ReadFromIcebergCDC | ||
| name: ReadFromBronzeDataset | ||
| config: | ||
| table: "shipment_dataset_bronze.shipments" | ||
| catalog_name: "shipment_data" | ||
| catalog_properties: | ||
| type: "rest" | ||
| uri: "https://biglake.googleapis.com/iceberg/v1beta/restcatalog" | ||
| warehouse: "gs://biglake_shipment_data" | ||
| header.x-goog-user-project: "apache-beam-testing" | ||
| rest.auth.type: "org.apache.iceberg.gcp.auth.GoogleAuthManager" | ||
| rest-metrics-reporting-enabled: "false" | ||
| filter: '"customer_id" IS NOT NULL AND "customer_id" = ''C1'' AND "shipment_cost" > 0' | ||
| keep: | ||
| - "customer_id" | ||
| - "shipment_date" | ||
| - "shipment_cost" | ||
| - "customer_name" | ||
| - "customer_email" | ||
|
|
||
| # Step 2: Write records out to Iceberg | ||
| - type: WriteToIceberg | ||
| name: WriteToSilverDataset | ||
| config: | ||
| table: "shipment_dataset_silver.shipments" | ||
| catalog_name: "shipment_data" | ||
| catalog_properties: | ||
| type: "rest" | ||
| uri: "https://biglake.googleapis.com/iceberg/v1beta/restcatalog" | ||
| warehouse: "gs://biglake_shipment_data" | ||
| header.x-goog-user-project: "apache-beam-testing" | ||
| rest.auth.type: "org.apache.iceberg.gcp.auth.GoogleAuthManager" | ||
| rest-metrics-reporting-enabled: "false" | ||
|
|
||
| # Expected: | ||
| # Row(customer_id='C1', shipment_date='2023-05-01', shipment_cost=150.0, customer_name='Alice', customer_email='[email protected]') | ||
| # Row(customer_id='C1', shipment_date='2023-05-10', shipment_cost=20.0, customer_name='Alice', customer_email='[email protected]') |
65 changes: 65 additions & 0 deletions
65
sdks/python/apache_beam/yaml/examples/transforms/blueprint/iceberg_to_iceberg_streaming.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # coding=utf-8 | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
|
|
||
| # A pipeline that reads Append CDC events from Medallion Bronze Iceberg dataset | ||
| # and writes to Silver Iceberg dataset. | ||
|
|
||
| pipeline: | ||
| type: chain | ||
| transforms: | ||
| # Step 1: Read CDC Append Records from Iceberg Table | ||
| - type: ReadFromIcebergCDC | ||
| name: ReadFromBronzeDataset | ||
| config: | ||
| table: "shipment_dataset_bronze.shipments" | ||
| catalog_name: "shipment_data" | ||
| catalog_properties: | ||
| type: "rest" | ||
| uri: "https://biglake.googleapis.com/iceberg/v1beta/restcatalog" | ||
| warehouse: "gs://biglake_shipment_data" | ||
| header.x-goog-user-project: "apache-beam-testing" | ||
| rest.auth.type: "org.apache.iceberg.gcp.auth.GoogleAuthManager" | ||
| rest-metrics-reporting-enabled: "false" | ||
| poll_interval_seconds: 30 | ||
| streaming: true | ||
| filter: '"customer_id" IS NOT NULL AND "customer_id" = ''C1'' AND "shipment_cost" > 0' | ||
| keep: | ||
| - "customer_id" | ||
| - "shipment_date" | ||
| - "shipment_cost" | ||
| - "customer_name" | ||
| - "customer_email" | ||
|
|
||
| # Step 2: Write records out to Iceberg | ||
| - type: WriteToIceberg | ||
| name: WriteToSilverDataset | ||
| config: | ||
| table: "shipment_dataset_silver.shipments" | ||
| catalog_name: "shipment_data" | ||
| catalog_properties: | ||
| type: "rest" | ||
| uri: "https://biglake.googleapis.com/iceberg/v1beta/restcatalog" | ||
| warehouse: "gs://biglake_shipment_data" | ||
| header.x-goog-user-project: "apache-beam-testing" | ||
| rest.auth.type: "org.apache.iceberg.gcp.auth.GoogleAuthManager" | ||
| rest-metrics-reporting-enabled: "false" | ||
| triggering_frequency_seconds: 30 | ||
|
|
||
| # Expected: | ||
| # Row(customer_id='C1', shipment_date='2023-05-01', shipment_cost=150.0, customer_name='Alice', customer_email='[email protected]') | ||
| # Row(customer_id='C1', shipment_date='2023-05-10', shipment_cost=20.0, customer_name='Alice', customer_email='[email protected]') | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.