List<RelDataTypeField> dimFields =
multiJoin.getJoinFactor(dimIdx).getRowType().getFieldList();
int nDimFields = dimFields.size();
Integer [] replacementKeys = new Integer[nDimFields];
SemiJoinRel semiJoin = multiJoin.getJoinRemovalSemiJoin(dimIdx);
ImmutableIntList dimKeys = semiJoin.getRightKeys();
ImmutableIntList factKeys = semiJoin.getLeftKeys();
for (int i = 0; i < dimKeys.size(); i++) {
replacementKeys[dimKeys.get(i)] = factKeys.get(i) + adjustment;
}
return createReplacementJoin(
multiJoin,
semiJoinOpt,