diff --git a/java/core/src/java/org/apache/orc/impl/RecordReaderImpl.java b/java/core/src/java/org/apache/orc/impl/RecordReaderImpl.java index 333cf5b9e1..48ba952606 100644 --- a/java/core/src/java/org/apache/orc/impl/RecordReaderImpl.java +++ b/java/core/src/java/org/apache/orc/impl/RecordReaderImpl.java @@ -650,8 +650,8 @@ static TruthValue evaluatePredicateProto(OrcProto.ColumnStatistics statsProto, " include ORC-517. Writer version: {}", predicate.getColumnName(), writerVersion); return TruthValue.YES_NO_NULL; - } else if (category == TypeDescription.Category.DOUBLE - || category == TypeDescription.Category.FLOAT) { + } else if ((category == TypeDescription.Category.DOUBLE || + category == TypeDescription.Category.FLOAT) && cs instanceof DoubleColumnStatistics) { DoubleColumnStatistics dstas = (DoubleColumnStatistics) cs; if (Double.isNaN(dstas.getSum())) { LOG.debug("Not using predication pushdown on {} because stats contain NaN values", @@ -1654,4 +1654,12 @@ public CompressionCodec getCompressionCodec() { public int getMaxDiskRangeChunkLimit() { return maxDiskRangeChunkLimit; } + + /** + * Get sargApplier for testing. + * @return sargApplier in record reader. + */ + SargApplier getSargApp() { + return sargApp; + } } diff --git a/java/core/src/test/org/apache/orc/impl/TestRecordReaderImpl.java b/java/core/src/test/org/apache/orc/impl/TestRecordReaderImpl.java index 85e502afbd..555954b080 100644 --- a/java/core/src/test/org/apache/orc/impl/TestRecordReaderImpl.java +++ b/java/core/src/test/org/apache/orc/impl/TestRecordReaderImpl.java @@ -41,6 +41,7 @@ import org.apache.orc.CompressionCodec; import org.apache.orc.CompressionKind; import org.apache.orc.DataReader; +import org.apache.orc.DoubleColumnStatistics; import org.apache.orc.OrcConf; import org.apache.orc.OrcFile; import org.apache.orc.OrcProto; diff --git a/java/core/src/test/resources/orc-file-no-double-statistic.orc b/java/core/src/test/resources/orc-file-no-double-statistic.orc new file mode 100644 index 0000000000..9da6e42e32 Binary files /dev/null and b/java/core/src/test/resources/orc-file-no-double-statistic.orc differ