Backport NPE fix for NULL partition conflict handling (#10680) to 1.5.2#246
Merged
jiang95-dev merged 1 commit intoJun 8, 2026
Conversation
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)
c3e2bda to
a73993d
Compare
jiang95-dev
approved these changes
Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type: Backport / cherry-pick
Backports the upstream Apache Iceberg fix for a
NullPointerExceptionduring conflict handling of NULL partitions (apache/iceberg#10680, released in 1.6.0) into theopenhouse-1.5.2line.Motivation: prerequisite for switching fork Trino from
org.apache.iceberg(1.6.1) tocom.linkedin.iceberg(1.5.2). Conflict validation on NULL / VOID-transform partitions currently throws an NPE instead of a properValidationException.Cherry-picked commit
Produced with
git cherry-pick -x(original authorship +(cherry picked from commit <sha>)provenance preserved):ed228f79cPartitionSet)Conflicts & resolution
The production fix (
PartitionSet.java) was cherry-picked unchanged.Only the two added tests conflicted, because
TestReplacePartitionsin 1.5.2.x is still on JUnit 4 while upstream had moved to JUnit 5.testValidateWithNullPartitionandtestValidateWithVoidTransformwere adapted to the JUnit 4 harness (logic and assertions unchanged):@TestTemplate->@TestassertThatThrownBy->Assertions.assertThatThrownByFiles.createTempDirectory(temp, "junit")->temp.newFolder()(JUnit 4TemporaryFolder)This deviation is documented in the commit message body.
Verification
./gradlew :iceberg-core:test --tests org.apache.iceberg.TestReplacePartitions— pass (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.