public static MapJoinOperator convertJoinOpMapJoinOp(HiveConf hconf,
      JoinOperator op, boolean leftInputJoin, String[] baseSrc, List<String> mapAliases,
      int mapJoinPos, boolean noCheckOuterJoin, boolean adjustParentsChildren)
          throws SemanticException {

    MapJoinDesc mapJoinDescriptor =
        getMapJoinDesc(hconf, op, leftInputJoin, baseSrc, mapAliases,
            mapJoinPos, noCheckOuterJoin, adjustParentsChildren);
    if (mapJoinDescriptor == null) {
      return null;
    }
    // reduce sink row resolver used to generate map join op
    RowSchema outputRS = op.getSchema();

    MapJoinOperator mapJoinOp = (MapJoinOperator) OperatorFactory.getAndMakeChild(
        op.getCompilationOpContext(), mapJoinDescriptor,
        new RowSchema(outputRS.getSignature()), op.getParentOperators());

    mapJoinOp.getConf().setReversedExprs(op.getConf().getReversedExprs());
    Map<String, ExprNodeDesc> colExprMap = op.getColumnExprMap();
    mapJoinOp.setColumnExprMap(colExprMap);

    List<Operator<? extends OperatorDesc>> childOps = op.getChildOperators();
    for (Operator<? extends OperatorDesc> childOp : childOps) {
      childOp.replaceParent(op, mapJoinOp);
    }

    mapJoinOp.setPosToAliasMap(op.getPosToAliasMap());
    mapJoinOp.setChildOperators(childOps);
    op.setChildOperators(null);
    op.setParentOperators(null);

    return mapJoinOp;

  }
convert a regular join to a a map-side join.

@param op
         join operator
@param mapJoinPos
         position of the source to be read as part of map-reduce framework. All other sources
         are cached in memory
@param noCheckOuterJoin
@param validateMapJoinTree
ql/src/java/org/apache/hadoop/hive/ql/optimizer/MapJoinProcessor.java