private int mapSideJoin(JoinOperator op) throws SemanticException {
    int mapJoinPos = -1;
    if (op.getConf().isMapSideJoin()) {
      int pos = 0;
      // In a map-side join, exactly one table is not present in memory.
      // The client provides the list of tables which can be cached in memory
      // via a hint.
      if (op.getConf().isLeftInputJoin()) {
        mapJoinPos = pos;
      }
      for (String src : op.getConf().getBaseSrc()) {
        if (src != null) {
          if (!op.getConf().getMapAliases().contains(src)) {
            if (mapJoinPos >= 0) {
              return -1;
            }
            mapJoinPos = pos;
          }
        }
        pos++;
      }

      // All tables are to be cached - this is not possible. In future, we can
      // support this by randomly
      // leaving some table from the list of tables to be cached
      if (mapJoinPos == -1) {
        throw new SemanticException(ErrorMsg.INVALID_MAPJOIN_HINT.getMsg(
            Arrays.toString(op.getConf().getBaseSrc())));
      }
    }

    return mapJoinPos;
  }
Is it a map-side join.

@param op
         join operator
@return -1 if it cannot be converted to a map-side join, position of the map join node
        otherwise
ql/src/java/org/apache/hadoop/hive/ql/optimizer/MapJoinProcessor.java