Skip to content

Backport NPE fix for NULL partition conflict handling (#10680) to 1.5.2#246

Merged
jiang95-dev merged 1 commit into
linkedin:openhouse-1.5.2from
cbb330:chbush/backport-null-partition-npe-1.5.2
Jun 8, 2026
Merged

Backport NPE fix for NULL partition conflict handling (#10680) to 1.5.2#246
jiang95-dev merged 1 commit into
linkedin:openhouse-1.5.2from
cbb330:chbush/backport-null-partition-npe-1.5.2

Conversation

@cbb330

@cbb330 cbb330 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Type: Backport / cherry-pick

Backports the upstream Apache Iceberg fix for a NullPointerException during conflict handling of NULL partitions (apache/iceberg#10680, released in 1.6.0) into the openhouse-1.5.2 line.

Motivation: prerequisite for switching fork Trino from org.apache.iceberg (1.6.1) to com.linkedin.iceberg (1.5.2). Conflict validation on NULL / VOID-transform partitions currently throws an NPE instead of a proper ValidationException.

Cherry-picked commit

Produced with git cherry-pick -x (original authorship + (cherry picked from commit <sha>) provenance preserved):

Apache PR Upstream release Upstream commit Description
apache/iceberg#10680 1.6.0 ed228f79c Fix NPE during conflict handling of NULL partitions (PartitionSet)

Conflicts & resolution

The production fix (PartitionSet.java) was cherry-picked unchanged.

Only the two added tests conflicted, because TestReplacePartitions in 1.5.2.x is still on JUnit 4 while upstream had moved to JUnit 5. testValidateWithNullPartition and testValidateWithVoidTransform were adapted to the JUnit 4 harness (logic and assertions unchanged):

  • @TestTemplate -> @Test
  • static assertThatThrownBy -> Assertions.assertThatThrownBy
  • Files.createTempDirectory(temp, "junit") -> temp.newFolder() (JUnit 4 TemporaryFolder)

This deviation is documented in the commit message body.

Verification

./gradlew :iceberg-core:test --tests org.apache.iceberg.TestReplacePartitionspass (96 run, 0 failures; JDK 17, Gradle 8.1.1 requires JDK <= 17).

Relationship to #245

Independent of #245 (disjoint files); the two backport PRs can be reviewed and merged in any order.

@github-actions github-actions Bot added the CORE label Jun 4, 2026
Backport note: the production fix (PartitionSet.java) was cherry-picked
unchanged. The two added tests (testValidateWithNullPartition,
testValidateWithVoidTransform) were adapted to the JUnit 4 test harness
used by TestReplacePartitions in 1.5.2.x (@testtemplate -> @test,
static assertThatThrownBy -> Assertions.assertThatThrownBy,
Files.createTempDirectory(temp, ...) -> temp.newFolder()). Test logic
and assertions are unchanged.

Core: Fix NPE during conflict handling of NULL partitions (#10680)

* Core: Fix NPE during conflict handling of NULL partitions

Partition values can be NULLs, or we can have NULLs because of
the VOID transforms. If a conflict is found in such partitions
we get a NullPointerException instead of a proper error message.

* Fix style issues

* Use String.valueOf()

* Reduce visibility of constant

Co-authored-by: Eduard Tudenhoefner <etudenhoefner@gmail.com>

* Indentation

* Update core/src/main/java/org/apache/iceberg/util/PartitionSet.java

---------

Co-authored-by: Fokko Driesprong <fokko@apache.org>
Co-authored-by: Eduard Tudenhoefner <etudenhoefner@gmail.com>
(cherry picked from commit ed228f7)
@cbb330 cbb330 force-pushed the chbush/backport-null-partition-npe-1.5.2 branch from c3e2bda to a73993d Compare June 4, 2026 00:33
@jiang95-dev jiang95-dev merged commit c3a07e2 into linkedin:openhouse-1.5.2 Jun 8, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants