public ParseContext transform(ParseContext pctx) throws SemanticException {

    Map<SemanticRule, SemanticNodeProcessor> opRules = new LinkedHashMap<SemanticRule, SemanticNodeProcessor>();
    BucketJoinProcCtx bucketMapJoinOptimizeCtx =
        new BucketJoinProcCtx(pctx.getConf());

    // process map joins with no reducers pattern
    opRules.put(new RuleRegExp("R1",
        MapJoinOperator.getOperatorName() + "%"),
        getBucketMapjoinProc(pctx));

    // The dispatcher fires the processor corresponding to the closest matching
    // rule and passes the context along
    SemanticDispatcher disp = new DefaultRuleDispatcher(getDefaultProc(), opRules,
        bucketMapJoinOptimizeCtx);
    SemanticGraphWalker ogw = new DefaultGraphWalker(disp);

    // Create a list of topop nodes
    List<Node> topNodes = new ArrayList<Node>();
    topNodes.addAll(pctx.getTopOps().values());
    ogw.startWalking(topNodes, null);

    return pctx;
  }
this transformation does bucket map join optimization.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/BucketMapJoinOptimizer.java