Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion java/core/src/java/org/apache/orc/impl/RecordReaderImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,8 @@ private static TruthValue evaluatePredicateMinMax(PredicateLeaf predicate,
// for a single value, look through to see if that value is in the
// set
for (Object arg : predicate.getLiteralList()) {
if (range.compare((Comparable) arg) == Location.MIN) {
predObj = getBaseObjectForComparison(predicate.getType(), (Comparable) arg);
if (range.compare(predObj) == Location.MIN) {
return range.addNull(TruthValue.YES);
}
}
Expand Down
17 changes: 17 additions & 0 deletions java/core/src/test/org/apache/orc/impl/TestRecordReaderImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,23 @@ public void testIn() throws Exception {
evaluateInteger(createIntStats(12L, 18L), pred));
}

@Test
public void testInDatePredConversion() {
List<Object> args = new ArrayList<>();
args.add(toDate(LocalDate.ofEpochDay(15)));
PredicateLeaf pred = createPredicateLeaf
(PredicateLeaf.Operator.IN, PredicateLeaf.Type.DATE,
"x", null, args);
assertEquals(TruthValue.YES_NULL,
evaluateInteger(createDateStats(15, 15), pred));
assertEquals(TruthValue.YES_NO_NULL,
evaluateInteger(createDateStats(10, 30), pred));
assertEquals(TruthValue.NO_NULL,
evaluateInteger(createDateStats(5, 10), pred));
assertEquals(TruthValue.NO_NULL,
evaluateInteger(createDateStats(16, 30), pred));
}

@Test
public void testBetween() {
List<Object> args = new ArrayList<Object>();
Expand Down