@Override
  public int computeStart(int rowIdx, PTFPartition p) throws HiveException {
    switch(start.getDirection()) {
    case PRECEDING:
      return computeStartPreceding(rowIdx, p);
    case CURRENT:
      return computeStartCurrentRow(rowIdx, p);
    case FOLLOWING:
      default:
        return computeStartFollowing(rowIdx, p);
    }
  }
Uses cache to lookup row value. Computes it on the fly on cache miss.
@param r
@param p
@return row value.
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/ValueBoundaryScanner.java