public @Nullable Integer getRightColumnMapping(int rightFactor, int rightOffset) {
    HiveLoptMultiJoin.RemovableSelfJoin selfJoin = requireNonNull(removableSelfJoinPairs.get(rightFactor),
            () -> "removableSelfJoinPairs.get(rightFactor) is null for " + rightFactor
                    + ", map=" + removableSelfJoinPairs);
    assert selfJoin.rightFactor == rightFactor;
    return selfJoin.columnMapping.get(rightOffset);
  }
Determines whether there is a mapping from a column in the right factor
of a self-join to a column from the left factor. Assumes that the right
factor is a part of a self-join.

@param rightFactor the index of the right factor
@param rightOffset the column offset of the right factor

@return the offset of the corresponding column in the left factor, if
such a column mapping exists; otherwise, null is returned
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveLoptMultiJoin.java