Uploaded image for project: 'ORC'
  1. ORC
  2. ORC-979 C++ API QA
  3. ORC-971

LESS_THAN_EQUALS doesn't handle the case when min=max

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.0
    • 1.7.0
    • C++
    • None

    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

          Activity

            People

              stigahuang Quanlong Huang
              stigahuang Quanlong Huang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: