private static String relativeOffsetWordToString(long relativeOffsetWord) {
    StringBuilder sb = new StringBuilder();

    sb.append(Long.toHexString(relativeOffsetWord));
    sb.append(", ");

    long nextRelativeOffset =
        (relativeOffsetWord & NextRelativeValueOffset.bitMask) >> NextRelativeValueOffset.bitShift;
    sb.append("nextRelativeOffset ");
    sb.append(nextRelativeOffset);
    sb.append(" (");
    sb.append(Long.toHexString(nextRelativeOffset));
    sb.append("), ");

    boolean isNextLast = ((relativeOffsetWord & IsNextValueLastFlag.flagOnMask) != 0);
    sb.append("isNextLast ");
    sb.append(isNextLast);
    sb.append(", ");

    boolean isNextValueLengthSmall =
        ((relativeOffsetWord & IsNextValueLengthSmallFlag.flagOnMask) != 0);
    sb.append("isNextValueLengthSmall ");
    sb.append(isNextValueLengthSmall);

    return sb.toString();
  }
Relative Offset Word stored at the beginning of all but the last value that has a
relative offset and 2 flags.

We put the flags at the low end of the word so the variable length integer will
encode smaller.

First bit is a flag indicating if the next value (not the current value) has a small length.
When the first value is added and it has a small length, that length is stored in the
value reference and not with the value.  So, when we have multiple values, we need a way to
know to keep the next value's small length with the current value.

Second bit is a flag indicating if the next value (not the current value) is the last value.

The relative offset *backwards* to the next value.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/mapjoin/fast/VectorMapJoinFastValueStore.java