From 7cd24d1869dfd4cb8c103899d6be7d0dbf497e4d Mon Sep 17 00:00:00 2001 From: "kedia,Akanksha" Date: Fri, 15 Dec 2023 21:53:54 +0530 Subject: [PATCH] Improve checks readibility Cherry-pick of https://github.com/trinodb/trino/commit/980eb8b489e379468c1b2ac7a0cce36ec83dcd14(trinodb/trino#7384) Co-authored-by: Piotr Findeisen --- .../presto/parquet/predicate/TupleDomainParquetPredicate.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);