Skip to content

[iceberg] Omit unknown bounds in Iceberg manifest partition summary - #9152

Open
thswlsqls wants to merge 1 commit into
apache:masterfrom
thswlsqls:fix/iceberg-partition-summary-null-bounds
Open

[iceberg] Omit unknown bounds in Iceberg manifest partition summary#9152
thswlsqls wants to merge 1 commit into
apache:masterfrom
thswlsqls:fix/iceberg-partition-summary-null-bounds

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Purpose

fix #9151

  • Committing a batch whose partition values are all NULL threw NPE: IcebergManifestEntryWriter.result() passed the unknown (null) partition min/max straight to IcebergConversions.toByteBuffer().
  • Omit unknown bounds instead. The Iceberg spec makes lower_bound (510) / upper_bound (511) optional, and IcebergPartitionSummary.schema() already declares both nullable.
  • Guard the reading side too, or the next non add-only commit hits the same null in toPaimonObject().
  • The sibling IcebergDataFileMeta.create() has omitted unknown bounds since [core] Add field statistics in IcebergDataFileMeta #4090; this path never got the equivalent guard.

Tests

  • Added IcebergCompatibilityTest#testNullPartitionValue: commits pt='a', a NULL-only batch, pt='b', then truncatePartitions(pt='a'); asserts the omitted bounds and reads every row via IcebergGenerics.
  • Reverting either source alone fails that test: toByteBuffer:83 without the writer guard, toPaimonObject:167 without the reader guard.
  • mvn -pl paimon-core -Dtest='Iceberg*Test' test — 159 tests passed (41 in IcebergCompatibilityTest), checkstyle and spotless clean.

When every entry of a manifest has a null partition value, the collected
partition statistics have no min/max, and IcebergManifestEntryWriter.result()
passed those nulls straight to IcebergConversions.toByteBuffer(), failing the
whole commit with a NullPointerException. Omit the bound instead, as the
Iceberg spec declares lower_bound (510) and upper_bound (511) optional.
Guard the reading side too, so a later non add-only commit does not hit the
same null in IcebergConversions.toPaimonObject().

Generated-by: Claude Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Committing only null partition values fails with NPE when Iceberg compatibility is enabled

1 participant