From b0e33dcc17530fc27c6550dfa3fec580c5b496db Mon Sep 17 00:00:00 2001 From: Russell Spitzer Date: Tue, 20 Apr 2021 15:20:29 -0500 Subject: [PATCH] Core: Fix NPE caused by Unboxing a Null in ManifestFileUtil (#2492) (#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. --- .../src/main/java/org/apache/iceberg/util/ManifestFileUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/apache/iceberg/util/ManifestFileUtil.java b/core/src/main/java/org/apache/iceberg/util/ManifestFileUtil.java index ac3014f11af8..c7f9b0b044b5 100644 --- a/core/src/main/java/org/apache/iceberg/util/ManifestFileUtil.java +++ b/core/src/main/java/org/apache/iceberg/util/ManifestFileUtil.java @@ -51,7 +51,7 @@ private static class FieldSummary { 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) {