diff --git a/presto-parquet/src/main/java/com/facebook/presto/parquet/predicate/TupleDomainParquetPredicate.java b/presto-parquet/src/main/java/com/facebook/presto/parquet/predicate/TupleDomainParquetPredicate.java index ea63248ac5e9..67b58fea07ca 100644 --- a/presto-parquet/src/main/java/com/facebook/presto/parquet/predicate/TupleDomainParquetPredicate.java +++ b/presto-parquet/src/main/java/com/facebook/presto/parquet/predicate/TupleDomainParquetPredicate.java @@ -103,11 +103,11 @@ public static Domain getDomain( return Domain.all(type); } - if (statistics.getNumNulls() == rowCount) { + if (statistics.isNumNullsSet() && statistics.getNumNulls() == rowCount) { return Domain.onlyNull(type); } - boolean hasNullValue = statistics.getNumNulls() != 0L; + boolean hasNullValue = !statistics.isNumNullsSet() || statistics.getNumNulls() != 0L; if (!statistics.hasNonNullValue() || statistics.genericGetMin() == null || statistics.genericGetMax() == null) { return Domain.create(ValueSet.all(type), hasNullValue);