protected Pair<Integer, Object> skipOrStepBack(int r, PTFPartition p)
          throws HiveException {
    Object rowVal = null;
    BoundaryCache cache = p.getBoundaryCache();

    Map.Entry<Integer, Object> floorEntry = null;
    Map.Entry<Integer, Object> ceilingEntry = null;

    if (cache != null) {
      floorEntry = cache.floorEntry(r);
      ceilingEntry = cache.ceilingEntry(r);
    }

    if (floorEntry != null && ceilingEntry != null) {
      r = floorEntry.getKey() - 1;
      floorEntry = cache.floorEntry(r);
      if (floorEntry != null) {
        rowVal = floorEntry.getValue();
      } else if (r >= 0){
        rowVal = computeValue(p.getAt(r));
      }
    } else {
      r--;
      if (r >= 0) {
        rowVal = computeValue(p.getAt(r));
      }
    }

    return new ImmutablePair<>(r, rowVal);
  }
Uses cache content to jump backwards if possible. If not, it steps one back.
@param r
@param p
@return pair of (row we stepped/jumped onto ; row value at this position)
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/ValueBoundaryScanner.java