question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullPointerException on containsNan()

See original GitHub issue

ContainsNan is a primitive boolean in ManifestFileUtil https://github.com/apache/iceberg/blob/6c6096d44cd1315c40e1e718c3186ba8927c3219/core/src/main/java/org/apache/iceberg/util/ManifestFileUtil.java#L45 But a boxed Boolean in GenericPartitionFieldSummary https://github.com/apache/iceberg/blob/6c6096d44cd1315c40e1e718c3186ba8927c3219/core/src/main/java/org/apache/iceberg/GenericPartitionFieldSummary.java#L45 This is also a problem because the interface for partition field summary also declares the return type to be boxed and returns null by default https://github.com/apache/iceberg/blob/6c6096d44cd1315c40e1e718c3186ba8927c3219/api/src/main/java/org/apache/iceberg/ManifestFile.java#L209-L211

Which can lead to an NPE if the GPFS = null

        Boolean x = null;
        boolean y = x; // NullPointerException
Caused by: java.lang.NullPointerException
	at org.apache.iceberg.util.ManifestFileUtil$FieldSummary.<init>(ManifestFileUtil.java:54)
	at org.apache.iceberg.util.ManifestFileUtil.summaries(ManifestFileUtil.java:150)
	at org.apache.iceberg.util.ManifestFileUtil.canContainAny(ManifestFileUtil.java:131)
	at org.apache.iceberg.ManifestFilterManager.canContainDeletedFiles(ManifestFilterManager.java:329)
	at org.apache.iceberg.ManifestFilterManager.filterManifest(ManifestFilterManager.java:285)
	at org.apache.iceberg.ManifestFilterManager.lambda$filterManifests$0(ManifestFilterManager.java:182)
	at org.apache.iceberg.util.Tasks$Builder.runTaskWithRetry(Tasks.java:404)
	at org.apache.iceberg.util.Tasks$Builder.access$300(Tasks.java:70)
	at org.apache.iceberg.util.Tasks$Builder$1.run(Tasks.java:310)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	... 3 more

#1872

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
RussellSpitzercommented, Apr 20, 2021

@yyanyy we can always patch it later if it causes an issue, but it least it won’t be a regression i’m introducing in this pr 😛

0reactions
yyanyycommented, Apr 20, 2021

You are right, the only caveat is that I think this requirement of not including NaN is only introduced not long ago. But yeah, I think we probably shouldn’t alter the current behavior.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - What is a NullPointerException, and how do I fix it?
new SomeInnerClass() throws a NullPointerException when foo is null. Method references of the form name1::name2 or primaryExpression::name throws a ...
Read more >
How to Fix and Avoid NullPointerException in Java - Rollbar
NullPointerException in Java occurs when a variable is accessed which is not pointing to any object and refers to nothing or null.
Read more >
Java NullPointerException - Detect, Fix, and Best Practices
The root cause is NullPointerException in the statement user.getUserId().toLowerCase() because user.getUserId() is returning null.
Read more >
NullPointerException (Java Platform SE 7 ) - Oracle Help Center
Thrown when an application attempts to use null in a case where an object is required. These include: Calling the instance method of...
Read more >
Content Engine Null Pointer Exception occurs if property with ...
APAR status. Closed as program error. Error description. NullPointerException occurs if timespan() is included in the filter expression of a Retention ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found