Description
When evaluating the LESS_THAN_EQUALS predicates, the case that has identical minValue and maxValue is not handled correctly. E.g. predicate "x <= 15" on a range [15, 15] should get YES or YES_NULL results. But what we currently get is YES_NO or YES_NO_NULL.
The issue is in evaluatePredicateRange():
https://github.com/apache/orc/blob/12e2f7488a7b5a11f734522dedf3648bd29cd1cc/c%2B%2B/src/sargs/PredicateLeaf.cc#L340-L348
case PredicateLeaf::Operator::LESS_THAN_EQUALS: loc = compareToRange(values.at(0), minValue, maxValue); if (loc == Location::AFTER || loc == Location::MAX) { // 'loc' could be MIN and minValue could equal to maxValue. This case is missed here. return hasNull ? TruthValue::YES_NULL : TruthValue::YES; } else if (loc == Location::BEFORE) { return hasNull ? TruthValue::NO_NULL : TruthValue::NO; } else { return hasNull ? TruthValue::YES_NO_NULL : TruthValue::YES_NO; }
Attachments
Issue Links
- links to