Skip to content

Fix IcebergIO failing to write EnumerationType (proto enum) fields - #40300

Merged
ahmedabu98 merged 1 commit into
apache:masterfrom
mananmangal:iceberg-enum-logical-type-40299
Sep 30, 2026
Merged

ahmedabu98 merged 1 commit into
apache:masterfrom
mananmangal:iceberg-enum-logical-type-40299

Conversation

@mananmangal

Copy link
Copy Markdown
Contributor

Fixes #40299

IcebergUtils didn't handle Row fields with the EnumerationType logical type (used for proto enums), so writing one threw Unsupported Beam logical type Enum during schema derivation, and a ClassCastException converting the row value even against a pre-existing table.

Maps EnumerationType to Iceberg's string type on write, the same way Avro (AvroUtils) and BigQuery (BigQueryUtils) already convert it.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@github-actions github-actions Bot added java io iceberg Iceberg IO connector labels Sep 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @Abacn for label java.
R: @ahmedabu98 for label iceberg.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

EnumerationType (used for proto enum fields) wasn't handled in
IcebergUtils's Beam-to-Iceberg schema and row conversion. Writing a Row
with such a field threw "Unsupported Beam logical type Enum" while
deriving the table schema, and threw a ClassCastException converting
the row's value even against a pre-existing table.

Map EnumerationType to Iceberg's string type on write, the same way
Avro and BigQuery already convert it.

Fixes apache#40299
@mananmangal
mananmangal force-pushed the iceberg-enum-logical-type-40299 branch from 76d37d7 to 31b8064 Compare September 29, 2026 18:21

@ahmedabu98 ahmedabu98 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.

LGTM, thanks for adding this!

@ahmedabu98
ahmedabu98 merged commit bbb71a0 into apache:master Sep 30, 2026
26 of 31 checks passed
@mananmangal
mananmangal deleted the iceberg-enum-logical-type-40299 branch October 1, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: IcebergIO cannot write Beam rows containing EnumerationType (proto enum) fields

2 participants