Skip to content

Commit

Permalink
Core: Fix NPE caused by Unboxing a Null in ManifestFileUtil (apache#2492
Browse files Browse the repository at this point in the history
) (apache#2495)

* Core: Fix NPE caused by Unboxing a Null in ManifestFileUtil

Previously the boxed value of containsNaN would be null if the table
was made before NaN stats were implemented. This leads to an NPE when
being unboxed. To fix this on null we report "true" since we do not know if the
 partition contains any NaN values.
  • Loading branch information
RussellSpitzer authored Apr 20, 2021
1 parent 4113c51 commit b0e33dc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private static class FieldSummary<T> {
this.lowerBound = Conversions.fromByteBuffer(primitive, summary.lowerBound());
this.upperBound = Conversions.fromByteBuffer(primitive, summary.upperBound());
this.containsNull = summary.containsNull();
this.containsNaN = summary.containsNaN();
this.containsNaN = summary.containsNaN() == null ? true : summary.containsNaN();
}

boolean canContain(Object value) {
Expand Down

0 comments on commit b0e33dc

Please sign in to comment.