Skip to content

[Bug]: IcebergIO write fails with "Null value set on non-nullable field keyMetadata" — @Nullable not detected in SerializableDataFile schema #38621

@mb0518

Description

@mb0518

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
  • Component: Java SDK
  • Component: Go SDK
  • Component: Typescript SDK
  • 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

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions