Skip to content

[yaml] - Expose IcebergAddFiles sort_fields option in ParquetToLakehouse - #4661

Draft
derrickaw wants to merge 1 commit into
mainfrom
yaml-drift/iceberg-addfiles-sort-fields
Draft

derrickaw wants to merge 1 commit into
mainfrom
yaml-drift/iceberg-addfiles-sort-fields

Conversation

@derrickaw

Copy link
Copy Markdown
Contributor

Note: this PR was auto-generated by tooling. Before moving it out of draft, the author has done a full review of the PR, specifically evaluating it on the following criteria:

  • The PR resolves YAML blueprint parameter drift tracked in YAML Blueprint Config Parameter Drift Report #4425 against the published Apache Beam YAML Transform Index
  • Any new/updated blueprint parameter preserves lossless Dataflow Job Builder Form loading and round-tripping (or is paired 1:1 with its companion Job Builder form update)
  • Java template interfaces (generate_yaml_java_templates.py), Spotless, Checkstyle, and unit tests have been verified

If you have concerns with the PR or with the underlying methodology used to generate this, please comment below - they will be addressed by the author not the tooling :)

Part of #4425 (#4425).

Summary

Exposes the optional sort_fields parameter on IcebergAddFiles in ParquetToLakehouse.yaml:

  • Adds optional lakehouseSortFields parameter (order: 7) to lakehouse_add_files_options in yaml/src/main/python/options/lakehouse_options.yaml matching Apache Beam's IcebergAddFiles.sort_fields specification (<term> [asc|desc] [nulls first|nulls last]).
  • Wires sort_fields: {{ lakehouseSortFields }} inside a {% if lakehouseSortFields %} guard in yaml/src/main/yaml/ParquetToLakehouse.yaml so existing jobs that omit lakehouseSortFields render identically.
  • Regenerates yaml/src/main/java/com/google/cloud/teleport/templates/yaml/ParquetToLakehouseYaml.java via generate_yaml_java_templates.py.

Verification

  • Verified Jinja/YAML rendering when lakehouseSortFields is omitted, empty string, and populated with sort order terms (["id asc", "day(ts) desc nulls last"]).
  • Verified generate_yaml_java_templates.py output, generate_yaml_java_templates_test.py (5/5), Spotless, Checkstyle (0 violations), and mvn test-compile -pl yaml.
@derrickaw derrickaw added the addition New feature or request label Dec 1, 2026
@derrickaw

Copy link
Copy Markdown
Contributor Author

/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 a new lakehouseSortFields template parameter to the Parquet to Lakehouse YAML template, allowing users to specify the sort order of tables when they are created. The parameter has been added to the Java interface ParquetToLakehouseYaml, the lakehouse_options.yaml configuration, and the pipeline definition in ParquetToLakehouse.yaml. There are no review comments, and I have no feedback to provide.

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/S

1 participant