@RequiresNonNull({"joinStart", "nFieldsInJoinFactor"})
  public int findRef(
          @UnknownInitialization HiveLoptMultiJoin this,
          int rexInputRef) {
    for (int i = 0; i < nJoinFactors; i++) {
      if ((rexInputRef >= joinStart[i])
              && (rexInputRef < (joinStart[i] + nFieldsInJoinFactor[i]))) {
        return i;
      }
    }
    throw new AssertionError();
  }
Determines the join factor corresponding to a RexInputRef.

@param rexInputRef rexInputRef index

@return index corresponding to join factor
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveLoptMultiJoin.java