Repository navigation
Add YAML tests for writing to Iceberg CDC sink - #40542
ahmedabu98 wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #40542 +/- ##
============================================
+ Coverage 56.16% 58.78% +2.61%
- Complexity 2288 13973 +11685
============================================
Files 1124 2595 +1471
Lines 178336 272476 +94140
Branches 1489 11305 +9816
============================================
+ Hits 100170 160170 +60000
- Misses 75645 106278 +30633
- Partials 2521 6028 +3507
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Assigning reviewers: R: @tvalentyn for label python. This pull request likely touches a core component ("core" label). Please review with scrutiny. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
| this.pendingSpec = StateSpecs.bag(CommitDeltas.windowedCommitCoder()); | ||
| } | ||
|
|
||
| @RequiresStableInput |
There was a problem hiding this comment.
Could you mention in the PR description why these were removed ? Won't this change the behavior for non-Dataflow runners ?
There was a problem hiding this comment.
Done. It would only change behavior for Flink, but we need it to run Python/YAML pipelines
| # 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 |
There was a problem hiding this comment.
Could you also try these against Dataflow ?
There was a problem hiding this comment.
We don't seem to have Dataflow YAML tests set up. I ran the following on Dataflow though and got the expected output:
DeltaLake to Iceberg:
pipeline:
type: chain
transforms:
- type: ReadFromDeltaCDC
config:
table: "gs://ahmedabualsaud/delta/orders"
start_version: 0
end_version: 3
include_metadata_columns: ["_change_type", "_commit_version"]
hadoop_config:
"fs.gs.impl": "com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystem"
"fs.AbstractFileSystem.gs.impl": "com.google.cloud.hadoop.fs.gcs.GoogleHadoopFS"
"fs.gs.auth.type": "APPLICATION_DEFAULT"
"fs.gs.project.id": "apache-beam-testing"
- type: WriteToIceberg
config:
table: "shop.orders_from_delta"
catalog_properties:
type: "hadoop"
warehouse: "gs://ahmedabualsaud/iceberg_cdc"
mode: "merge-on-read"
equality_columns: ["id"]
change_type_column: "_change_type"
change_type_map:
insert: "INSERT"
update_preimage: "UPDATE_BEFORE"
update_postimage: "UPDATE_AFTER"
delete: "DELETE"
sequence_number_column: "_commit_version"Iceberg to Iceberg:
pipeline:
type: chain
transforms:
- type: ReadFromIcebergCDC
config:
table: "shop.orders_from_delta"
catalog_properties:
type: "hadoop"
warehouse: "gs://ahmedabualsaud/iceberg_cdc"
config_properties:
"fs.gs.impl": "com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystem"
"fs.AbstractFileSystem.gs.impl": "com.google.cloud.hadoop.fs.gcs.GoogleHadoopFS"
"fs.gs.auth.type": "APPLICATION_DEFAULT"
"fs.gs.project.id": "apache-beam-testing"
include_metadata_columns: ["_change_type", "_commit_snapshot_sequence_number"]
- type: WriteToIceberg
config:
table: "shop.orders_from_iceberg"
catalog_properties:
type: "hadoop"
warehouse: "gs://ahmedabualsaud/iceberg_cdc"
mode: "merge-on-read"
equality_columns: ["id"]
change_type_column: "_change_type"|
4 reviewers is too many :) assigning to Cham since you have the best context and have already started the review - thanks R: @chamikaramj |
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
Adds YAML tests for:
Adds a small fix to let Python recognize columns that start with an underscore
"-"when converting Beam Rows to native objects (needed for xlang, yaml)Removing
@RequiresStableInputso the sink can run on the local FnApiRunner (which Python and YAML use). This is semantic anyways because GroupByKey right before the commit already keeps its input stable. Only real behavior change is on Flink runner, which isn't included in tests yet