Skip to content

API: Guard against null in Evaluator.in() to avoid NPE#17014

Open
ebyhr wants to merge 1 commit into
apache:mainfrom
ebyhr:ebi/npe
Open

API: Guard against null in Evaluator.in() to avoid NPE#17014
ebyhr wants to merge 1 commit into
apache:mainfrom
ebyhr:ebi/npe

Conversation

@ebyhr

@ebyhr ebyhr commented Jun 30, 2026

Copy link
Copy Markdown
Member

Regression introduced in 1.11.0 via commit d894a02 (Core: Align CharSequenceSet impl with Data/DeleteFileSet).

Before 1.11.0, CharSequenceSet.contains(null) returned false safely via instanceof check. After 1.11.0, it inherited WrapperSet.contains() which throws NPE.

java.lang.NullPointerException: Invalid object: null
	at org.apache.iceberg.relocated.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:974)
	at org.apache.iceberg.util.WrapperSet.contains(WrapperSet.java:72)
	at org.apache.iceberg.util.CharSequenceSet.contains(CharSequenceSet.java:24)
	at org.apache.iceberg.expressions.Evaluator$EvalVisitor.in(Evaluator.java:141)
	at org.apache.iceberg.expressions.Evaluator$EvalVisitor.in(Evaluator.java:51)
	at org.apache.iceberg.expressions.ExpressionVisitors$BoundVisitor.predicate(ExpressionVisitors.java:313)
	at org.apache.iceberg.expressions.ExpressionVisitors.visitEvaluator(ExpressionVisitors.java:390)
	at org.apache.iceberg.expressions.ExpressionVisitors.visitEvaluator(ExpressionVisitors.java:405)
	at org.apache.iceberg.expressions.ExpressionVisitors.visitEvaluator(ExpressionVisitors.java:405)
	at org.apache.iceberg.expressions.Evaluator$EvalVisitor.eval(Evaluator.java:56)
	at org.apache.iceberg.expressions.Evaluator.eval(Evaluator.java:48)
	at org.apache.iceberg.ManifestReader.lambda$entries$0(ManifestReader.java:273)
	at org.apache.iceberg.io.CloseableIterable$5.shouldKeep(CloseableIterable.java:156)
	at org.apache.iceberg.io.FilterIterator.advance(FilterIterator.java:66)
	at org.apache.iceberg.io.FilterIterator.hasNext(FilterIterator.java:49)
	at org.apache.iceberg.io.FilterIterator.advance(FilterIterator.java:64)
	at org.apache.iceberg.io.FilterIterator.hasNext(FilterIterator.java:49)
	at org.apache.iceberg.io.CloseableIterable$7$1.hasNext(CloseableIterable.java:214)
	at org.apache.iceberg.util.ParallelIterable$Task.get(ParallelIterable.java:283)
	at org.apache.iceberg.util.ParallelIterable$Task.get(ParallelIterable.java:244)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1789)

I plan to backport this change to 1.11.x branch once this PR is merged.

@ebyhr ebyhr marked this pull request as ready for review June 30, 2026 04:24

@singhpk234 singhpk234 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.

LGTM, thanks @ebyhr

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.

4 participants