protected void func(BytesColumnVector outV, byte[][] vector, int[] start, int[] length,
      int batchIndex) {

    byte[] bytes = vector[batchIndex];
    final int startIndex = start[batchIndex];

    // Skip trailing blank characters.
    int index = startIndex + length[batchIndex] - 1;
    while(index >= startIndex && shouldTrim(bytes[index])) {
      index--;
    }

    final int resultLength = index - startIndex + 1;
    if (resultLength == 0) {
      outV.setVal(batchIndex, EMPTY_BYTES, 0, 0);
      return;
    }
    outV.setVal(batchIndex, bytes, startIndex, resultLength);
  }
RTRIM element i of the vector, and place the result in outV.
Operate on the data in place, and set the output by reference
to improve performance. Ignore null handling. That will be handled separately.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringRTrimColScalar.java