Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
66fc208
add delta lake to iceberg IT
derrickaw Aug 3, 2026
92aadfa
fix spotless and rerun auto-generation
derrickaw Aug 3, 2026
9caddc2
switch to interrupt call
derrickaw Aug 5, 2026
ece2e53
change to a dynamic import to fix error
derrickaw Aug 17, 2026
58cc7cc
add forgotten yaml definition file
derrickaw Aug 17, 2026
6f0eb7d
add generated README for DeltaLakeToIceberg template
derrickaw Aug 17, 2026
353123c
switch back to stop method for direct runner
derrickaw Aug 18, 2026
0b6fa4a
address gemini comment
derrickaw Aug 18, 2026
a9b0bcf
spotless
derrickaw Aug 18, 2026
9fdced5
initial comments fixes
derrickaw Aug 25, 2026
ee83e6e
change iceberg to lakehouse
derrickaw Aug 25, 2026
99d9dd5
change to a wrapped writetoiceberg via writetolakehouse
derrickaw Aug 25, 2026
0dc18f3
update yaml file with wrapper transform
derrickaw Aug 25, 2026
e35c1d2
remove old writetolakehouse transform idea
derrickaw Aug 25, 2026
a0cf3b4
spotless
derrickaw Aug 25, 2026
a323e94
change to renamed transform
derrickaw Aug 25, 2026
bf3e10c
address Delta client comment
derrickaw Aug 28, 2026
f1580c4
spotless
derrickaw Aug 28, 2026
498d496
Merge remote-tracking branch 'upstream/main' into 20260803_addDeltaLa…
derrickaw Aug 28, 2026
3cfd16c
fix generated file
derrickaw Aug 28, 2026
12f799e
create write to lakehouse
derrickaw Aug 28, 2026
aa73a25
change package
derrickaw Aug 29, 2026
a6e7bad
oops - used wrong assumed date
derrickaw Aug 29, 2026
f0e93b3
fix uri catalog version
derrickaw Aug 29, 2026
1300f82
update jar to to be the same
derrickaw Aug 29, 2026
6333399
change to managed and mimic deltalake
derrickaw Aug 29, 2026
ef2df8e
update one more version jar
derrickaw Aug 29, 2026
5dd1cc4
add manifest resource transformer
derrickaw Aug 29, 2026
86f5da5
add managed and iceberg
derrickaw Aug 29, 2026
90c0458
change pattern
derrickaw Aug 30, 2026
b6f16a0
force to schemaAwareExternalTransform
derrickaw Aug 30, 2026
8973be4
another try
derrickaw Aug 31, 2026
655f3a8
add transformer
derrickaw Aug 31, 2026
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
254 changes: 254 additions & 0 deletions yaml/README_DeltaLake_To_Iceberg_Yaml.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@

Delta Lake to Lakehouse template
---
The Delta Lake to Iceberg template is a batch pipeline that reads data from a
Delta Lake table and outputs the records to an Apache Iceberg table.



:bulb: This is a generated documentation based
on [Metadata Annotations](https://github.com/GoogleCloudPlatform/DataflowTemplates/blob/main/contributor-docs/code-contributions.md#metadata-annotations)
. Do not change this file directly.

## Parameters

### Required parameters

* **deltaLakeTable**: The GCS path to the Delta Lake table, e.g., gs://your-bucket/path/to/table. For example, `gs://your-bucket/path/to/table`.
* **table**: A fully-qualified table identifier, e.g., my_dataset.my_table. For example, `my_dataset.my_table`.
* **catalogName**: The name of the Iceberg catalog that contains the table. For example, `my_hadoop_catalog`.
* **catalogProperties**: A map of properties for setting up the Iceberg catalog. For example, `{"type": "hadoop", "warehouse": "gs://your-bucket/warehouse"}`.

### Optional parameters

* **deltaLakeHadoopConfig**: A map of properties to pass to Hadoop Configuration, e.g. key-value pairs. For example, `{"fs.gs.impl": "com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystem"}`.
* **configProperties**: A map of properties to pass to the Hadoop Configuration. For example, `{"fs.gs.impl": "com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystem"}`.
* **drop**: A list of field names to drop. Mutually exclusive with 'keep' and 'only'. For example, `["field_to_drop_1", "field_to_drop_2"]`.
* **filter**: A filter expression to apply to records from the Iceberg table. For example, `age > 18`.
* **keep**: A list of field names to keep. Mutually exclusive with 'drop' and 'only'. For example, `["field_to_keep_1", "field_to_keep_2"]`.
* **only**: The name of a single field to write. Mutually exclusive with 'keep' and 'drop'. For example, `my_record_field`.
* **partitionFields**: A list of fields and transforms for partitioning, e.g., ['day(ts)', 'category']. For example, `["day(ts)", "bucket(id, 4)"]`.
* **tableProperties**: A map of Iceberg table properties to set when the table is created. For example, `{"commit.retry.num-retries": "2"}`.



## Getting Started

### Requirements

* Java 17
* Maven
* [gcloud CLI](https://cloud.google.com/sdk/gcloud), and execution of the
following commands:
* `gcloud auth login`
* `gcloud auth application-default login`

:star2: Those dependencies are pre-installed if you use Google Cloud Shell!

[![Open in Cloud Shell](http://gstatic.com/cloudssh/images/open-btn.svg)](https://console.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2FGoogleCloudPlatform%2FDataflowTemplates.git&cloudshell_open_in_editor=yaml/src/main/java/com/google/cloud/teleport/templates/yaml/DeltaLakeToIcebergYaml.java)

### Templates Plugin

This README provides instructions using
the [Templates Plugin](https://github.com/GoogleCloudPlatform/DataflowTemplates/blob/main/contributor-docs/code-contributions.md#templates-plugin).

#### Validating the Template

This template has a validation command that is used to check code quality.

```shell
mvn clean install -PtemplatesValidate \
-DskipTests -am \
-pl yaml
```

### Building Template

This template is a Flex Template, meaning that the pipeline code will be
containerized and the container will be executed on Dataflow. Please
check [Use Flex Templates](https://cloud.google.com/dataflow/docs/guides/templates/using-flex-templates)
and [Configure Flex Templates](https://cloud.google.com/dataflow/docs/guides/templates/configuring-flex-templates)
for more information.

#### Staging the Template

If the plan is to just stage the template (i.e., make it available to use) by
the `gcloud` command or Dataflow "Create job from template" UI,
the `-PtemplatesStage` profile should be used:

```shell
export PROJECT=<my-project>
export BUCKET_NAME=<bucket-name>
export ARTIFACT_REGISTRY_REPO=<region>-docker.pkg.dev/$PROJECT/<repo>

mvn clean package -PtemplatesStage \
-DskipTests \
-DprojectId="$PROJECT" \
-DbucketName="$BUCKET_NAME" \
-DartifactRegistry="$ARTIFACT_REGISTRY_REPO" \
-DstagePrefix="templates" \
-DtemplateName="DeltaLake_To_Iceberg_Yaml" \
-f yaml
```

The `-DartifactRegistry` parameter can be specified to set the artifact registry repository of the Flex Templates image.
If not provided, it defaults to `gcr.io/<project>`.

The command should build and save the template to Google Cloud, and then print
the complete location on Cloud Storage:

```
Flex Template was staged! gs://<bucket-name>/templates/flex/DeltaLake_To_Iceberg_Yaml
```

The specific path should be copied as it will be used in the following steps.

#### Running the Template

**Using the staged template**:

You can use the path above run the template (or share with others for execution).

To start a job with the template at any time using `gcloud`, you are going to
need valid resources for the required parameters.

Provided that, the following command line can be used:

```shell
export PROJECT=<my-project>
export BUCKET_NAME=<bucket-name>
export REGION=us-central1
export TEMPLATE_SPEC_GCSPATH="gs://$BUCKET_NAME/templates/flex/DeltaLake_To_Iceberg_Yaml"

### Required
export DELTA_LAKE_TABLE=<deltaLakeTable>
export TABLE=<table>
export CATALOG_NAME=<catalogName>
export CATALOG_PROPERTIES=<catalogProperties>

### Optional
export DELTA_LAKE_HADOOP_CONFIG=<deltaLakeHadoopConfig>
export CONFIG_PROPERTIES=<configProperties>
export DROP=<drop>
export FILTER=<filter>
export KEEP=<keep>
export ONLY=<only>
export PARTITION_FIELDS=<partitionFields>
export TABLE_PROPERTIES=<tableProperties>

gcloud dataflow flex-template run "deltalake-to-iceberg-yaml-job" \
--project "$PROJECT" \
--region "$REGION" \
--template-file-gcs-location "$TEMPLATE_SPEC_GCSPATH" \
--parameters "deltaLakeTable=$DELTA_LAKE_TABLE" \
--parameters "deltaLakeHadoopConfig=$DELTA_LAKE_HADOOP_CONFIG" \
--parameters "table=$TABLE" \
--parameters "catalogName=$CATALOG_NAME" \
--parameters "catalogProperties=$CATALOG_PROPERTIES" \
--parameters "configProperties=$CONFIG_PROPERTIES" \
--parameters "drop=$DROP" \
--parameters "filter=$FILTER" \
--parameters "keep=$KEEP" \
--parameters "only=$ONLY" \
--parameters "partitionFields=$PARTITION_FIELDS" \
--parameters "tableProperties=$TABLE_PROPERTIES"
```

For more information about the command, please check:
https://cloud.google.com/sdk/gcloud/reference/dataflow/flex-template/run


**Using the plugin**:

Instead of just generating the template in the folder, it is possible to stage
and run the template in a single command. This may be useful for testing when
changing the templates.

```shell
export PROJECT=<my-project>
export BUCKET_NAME=<bucket-name>
export REGION=us-central1

### Required
export DELTA_LAKE_TABLE=<deltaLakeTable>
export TABLE=<table>
export CATALOG_NAME=<catalogName>
export CATALOG_PROPERTIES=<catalogProperties>

### Optional
export DELTA_LAKE_HADOOP_CONFIG=<deltaLakeHadoopConfig>
export CONFIG_PROPERTIES=<configProperties>
export DROP=<drop>
export FILTER=<filter>
export KEEP=<keep>
export ONLY=<only>
export PARTITION_FIELDS=<partitionFields>
export TABLE_PROPERTIES=<tableProperties>

mvn clean package -PtemplatesRun \
-DskipTests \
-DprojectId="$PROJECT" \
-DbucketName="$BUCKET_NAME" \
-Dregion="$REGION" \
-DjobName="deltalake-to-iceberg-yaml-job" \
-DtemplateName="DeltaLake_To_Iceberg_Yaml" \
-Dparameters="deltaLakeTable=$DELTA_LAKE_TABLE,deltaLakeHadoopConfig=$DELTA_LAKE_HADOOP_CONFIG,table=$TABLE,catalogName=$CATALOG_NAME,catalogProperties=$CATALOG_PROPERTIES,configProperties=$CONFIG_PROPERTIES,drop=$DROP,filter=$FILTER,keep=$KEEP,only=$ONLY,partitionFields=$PARTITION_FIELDS,tableProperties=$TABLE_PROPERTIES" \
-f yaml
```

## Terraform

Dataflow supports the utilization of Terraform to manage template jobs,
see [dataflow_flex_template_job](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/dataflow_flex_template_job).

Terraform modules have been generated for most templates in this repository. This includes the relevant parameters
specific to the template. If available, they may be used instead of
[dataflow_flex_template_job](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/dataflow_flex_template_job)
directly.

To use the autogenerated module, execute the standard
[terraform workflow](https://developer.hashicorp.com/terraform/intro/core-workflow):

```shell
cd yaml/terraform/DeltaLake_To_Iceberg_Yaml
terraform init
terraform apply
```

To use
[dataflow_flex_template_job](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/dataflow_flex_template_job)
directly:

```terraform
provider "google-beta" {
project = var.project
}
variable "project" {
default = "<my-project>"
}
variable "region" {
default = "us-central1"
}

resource "google_dataflow_flex_template_job" "deltalake_to_iceberg_yaml" {

provider = google-beta
container_spec_gcs_path = "gs://dataflow-templates-${var.region}/latest/flex/DeltaLake_To_Iceberg_Yaml"
name = "deltalake-to-iceberg-yaml"
region = var.region
parameters = {
deltaLakeTable = "<deltaLakeTable>"
table = "<table>"
catalogName = "<catalogName>"
catalogProperties = "<catalogProperties>"
# deltaLakeHadoopConfig = "<deltaLakeHadoopConfig>"
# configProperties = "<configProperties>"
# drop = "<drop>"
# filter = "<filter>"
# keep = "<keep>"
# only = "<only>"
# partitionFields = "<partitionFields>"
# tableProperties = "<tableProperties>"
}
}
```
Loading
Loading