Skip to content

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

Merged
Fokko merged 6 commits into
apache:mainfrom
boroknagyz:NullPartitionConflict
Jul 12, 2024
Merged

Core: Fix NPE during conflict handling of NULL partitions#10680
Fokko merged 6 commits into
apache:mainfrom
boroknagyz:NullPartitionConflict

Conversation

@boroknagyz

Copy link
Copy Markdown
Contributor

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.

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.
@github-actions github-actions Bot added the core label Jul 11, 2024
Comment thread core/src/main/java/org/apache/iceberg/util/PartitionSet.java Outdated

@deniskuzZ deniskuzZ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1

@ajantha-bhat

Copy link
Copy Markdown
Member

Closing and repoening PR to trigger CI build. The current failure is unrelated.

@ajantha-bhat ajantha-bhat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Since it is NPE, I think we can have it in 1.6.0
@Fokko, @nastra, @jbonofre: WDYT?

@jbonofre

Copy link
Copy Markdown
Member

It looks good to me indeed.

@ajantha-bhat ajantha-bhat added this to the Iceberg 1.6.0 milestone Jul 12, 2024

@Fokko Fokko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this @boroknagyz, thanks for adding this to the milestone @ajantha-bhat, and thanks for the review @ajantha-bhat & @jbonofre

Comment thread core/src/test/java/org/apache/iceberg/TestReplacePartitions.java Outdated
Co-authored-by: Eduard Tudenhoefner <etudenhoefner@gmail.com>
Comment thread core/src/test/java/org/apache/iceberg/TestReplacePartitions.java Outdated
Comment thread core/src/main/java/org/apache/iceberg/util/PartitionSet.java Outdated
@Fokko Fokko merged commit ed228f7 into apache:main Jul 12, 2024
@Fokko

Fokko commented Jul 12, 2024

Copy link
Copy Markdown
Contributor

Thanks for fixing this @boroknagyz , and thanks for the review @ajantha-bhat, @jbonofre, @deniskuzZ and @nastra

jasonf20 pushed a commit to jasonf20/iceberg that referenced this pull request Aug 4, 2024
* 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>
zachdisc pushed a commit to zachdisc/iceberg that referenced this pull request Dec 23, 2024
* 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>
cbb330 pushed a commit to cbb330/iceberg that referenced this pull request 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)
jiang95-dev pushed a commit to linkedin/iceberg that referenced this pull request Jun 8, 2026
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.

6 participants