@Override
  public ParseContext transform(ParseContext pctx) throws SemanticException {

    // create a the context for walking operators
    List<PcrOpWalkerCtx.OpToDeleteInfo> opToRemove =
        new ArrayList<PcrOpWalkerCtx.OpToDeleteInfo>();
    PcrOpWalkerCtx opWalkerCtx = new PcrOpWalkerCtx(pctx, opToRemove);

    Map<SemanticRule, SemanticNodeProcessor> opRules = new LinkedHashMap<SemanticRule, SemanticNodeProcessor>();
    opRules.put(new RuleRegExp("R1",
      "(" + TableScanOperator.getOperatorName() + "%"
      + FilterOperator.getOperatorName() + "%)|("
      + TableScanOperator.getOperatorName() + "%"
      + FilterOperator.getOperatorName() + "%"
      + FilterOperator.getOperatorName() + "%)"),
      PcrOpProcFactory.getFilterProc());

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

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

    for (PcrOpWalkerCtx.OpToDeleteInfo entry : opToRemove) {
      entry.getParent().removeChildAndAdoptItsChildren(entry.getOperator());
    }

    return pctx;
  }
The transformation step that does partition condition remover.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/pcr/PartitionConditionRemover.java