Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions sdks/python/apache_beam/yaml/standard_io.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -393,3 +393,24 @@
'ReadFromIcebergCDC': 'beam:schematransform:org.apache.beam:iceberg_cdc_read:v1'
config:
gradle_target: 'sdks:java:io:expansion-service:shadowJar'

#IcebergAddFiles
- type: renaming
transforms:
'IcebergAddFiles': 'IcebergAddFiles'
config:
mappings:
'IcebergAddFiles':
table: 'table'
catalog_properties: 'catalog_properties'
config_properties: 'config_properties'
triggering_frequency_seconds: 'triggering_frequency_seconds'
append_batch_size: 'append_batch_size'
location_prefix: 'location_prefix'
underlying_provider:
type: beamJar
transforms:
'IcebergAddFiles': 'beam:schematransform:iceberg_add_files:v1'
config:
gradle_target: 'sdks:java:io:expansion-service:shadowJar'

55 changes: 55 additions & 0 deletions sdks/python/apache_beam/yaml/tests/iceberg_add_files.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#
# 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.
#

fixtures:
- name: TEMP_DIR
type: "tempfile.TemporaryDirectory"

pipelines:
# Pipeline 1: Write a dummy Parquet file
- pipeline:
type: chain
transforms:
- type: Create
config:
elements:
- {label: "11a", rank: 0, bool: true}
- {label: "37a", rank: 1, bool: false}
- {label: "389a", rank: 2, bool: false}
- {label: "3821b", rank: 3, bool: true}
- {label: "990c", rank: 4, bool: true}
- {label: "1024d", rank: 5, bool: false}
- type: WriteToParquet
config:
path: "{TEMP_DIR}/data/data"

# Pipeline 2: Add our generated file to the Iceberg table
- pipeline:
type: chain
transforms:
- type: Create
config:
elements:
# By default, Beam writes a sharded file like <prefix>-00000-of-00001
- {file: "{TEMP_DIR}/data/data-00000-of-00001"}
- type: IcebergAddFiles
config:
table: "default.table"
location_prefix: "{TEMP_DIR}/data/"
catalog_properties:
type: "hadoop"
warehouse: "{TEMP_DIR}/dir"
Loading