NullPointerException on containsNan()
See original GitHub issueContainsNan 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
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (15 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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 😛
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.