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

   ### What happened?
   
   When writing to an Iceberg table via `IcebergIO` on Dataflow, the pipeline 
fails with `IllegalArgumentException` during encoding of `FileWriteResult`. The 
root cause is:
   
   ```
   java.lang.RuntimeException: Null value set on non-nullable field
   Field{name=keyMetadata, description=, type=BYTES NOT NULL, options={{}}}
   ```
   The `SerializableDataFile` schema at runtime marks **all fields as NOT 
NULL**, despite fields 6–13 (`keyMetadata`, `splitOffsets`, `columnSizes`, 
`valueCounts`, `nullValueCounts`, `nanValueCounts`, `lowerBounds`, 
`upperBounds`) being declared with `@Nullable` in the source code.
   
   The `@Nullable` annotation used is 
`org.checkerframework.checker.nullness.qual.Nullable` (a `TYPE_USE` 
annotation), which `AutoValueSchema` / 
`FieldValueTypeInformation.hasNullableReturnType()` appears to not detect at 
runtime.
   
   The error surfaces on `keyMetadata` because it is the first field that is 
actually `null` (normal for unencrypted Iceberg tables), but the issue affects 
all nullable fields in `SerializableDataFile`.
   
   ### Issue Priority
   
   Priority: 1 (data loss / total loss of function)
   
   ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to