You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "mananmangal (via GitHub)" <gi...@apache.org> on 2026/09/27 17:57:40 UTC

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

mananmangal opened a new issue, #40299:
URL: https://github.com/apache/beam/issues/40299

   ### What happened?
   
   Writing a `Row` with an `EnumerationType` logical type field (e.g. from `ProtoSchemaTranslator` on a proto message with an `enum` field) to `IcebergIO.writeRows()` fails. `EnumerationType` isn't one of the cases [handled here](https://github.com/apache/beam/blob/020707df9d6d0276a936d98e4f79f4792e761005/sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/IcebergUtils.java#L236), so schema derivation throws immediately:
   
   ```
   java.lang.RuntimeException: Unsupported Beam logical type Enum
         at org.apache.beam.sdk.io.iceberg.IcebergUtils.beamFieldTypeToIcebergFieldType(IcebergUtils.java:236)
         at org.apache.beam.sdk.io.iceberg.IcebergUtils.beamSchemaToIcebergSchema(IcebergUtils.java:323)
   ```
   
   Pre-creating the table doesn't help either. `copyFieldIntoRecord` calls `Row.getString()`/`Row.getInt32()` [directly](https://github.com/apache/beam/blob/020707df9d6d0276a936d98e4f79f4792e761005/sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/IcebergUtils.java#L392), so it fails trying to cast the field's `EnumerationType.Value` to `String`:
   
   ```
   java.lang.ClassCastException: class org.apache.beam.sdk.schemas.logicaltypes.EnumerationType$Value cannot be cast to class java.lang.String
         at org.apache.beam.sdk.io.iceberg.IcebergUtils.copyFieldIntoRecord(IcebergUtils.java:392)
   ```
   
   Avro (`AvroUtils.genericFromBeamField`) and BigQuery (`BigQueryUtils.fromBeamField`) already convert `EnumerationType` to a string on write, so there's a working pattern to follow here.
   
   ### Issue Priority
   
   Priority: 2 (default / most bugs should be filed as P2)
   
   ### Issue Components
   
   - [ ] Component: Python SDK
   - [x] Component: Java SDK
   - [ ] Component: Go SDK
   - [ ] Component: Typescript SDK
   - [x] Component: IO connector
   - [ ] Component: Beam YAML
   - [ ] Component: Beam examples
   - [ ] Component: Beam playground
   - [ ] Component: Beam katas
   - [ ] Component: Website
   - [ ] Component: Infrastructure
   - [ ] Component: Spark Runner
   - [ ] Component: Flink Runner
   - [ ] Component: Prism Runner
   - [ ] Component: Twister2 Runner
   - [ ] Component: Hazelcast Jet Runner
   - [ ] Component: Google Cloud Dataflow Runner


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 closed issue #40299: [Bug]: IcebergIO cannot write Beam rows containing EnumerationType (proto enum) fields
URL: https://github.com/apache/beam/issues/40299


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

Posted by "mananmangal (via GitHub)" <gi...@apache.org>.
mananmangal commented on issue #40299:
URL: https://github.com/apache/beam/issues/40299#issuecomment-5858368457

   .take-issue


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org