private void evaluateOperators(BaseWork w, PhysicalContext pctx) throws SemanticException {

      SemanticDispatcher disp = null;
      final Set<TableScanOperator> tableScans = new LinkedHashSet<TableScanOperator>();

      LinkedHashMap<SemanticRule, SemanticNodeProcessor> rules = new LinkedHashMap<SemanticRule, SemanticNodeProcessor>();
      rules.put(new RuleRegExp("TS finder",
              TableScanOperator.getOperatorName() + "%"), new SemanticNodeProcessor() {
          @Override
          public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx,
              Object... nodeOutputs) {
            tableScans.add((TableScanOperator) nd);
            return null;
          }
        });
      disp = new DefaultRuleDispatcher(null, rules, null);

      SemanticGraphWalker ogw = new DefaultGraphWalker(disp);

      ArrayList<Node> topNodes = new ArrayList<Node>();
      topNodes.addAll(w.getAllRootOperators());

      LinkedHashMap<Node, Object> nodeOutput = new LinkedHashMap<Node, Object>();
      ogw.startWalking(topNodes, nodeOutput);

      for (TableScanOperator ts: tableScans) {
        if (ts.getConf() != null && ts.getConf().getFilterExpr() != null) {
          if (LOG.isDebugEnabled()) {
            LOG.debug("Serializing: " + ts.getConf().getFilterExpr().getExprString());
          }
          ts.getConf().setSerializedFilterExpr(
              SerializationUtilities.serializeExpression(ts.getConf().getFilterExpr()));
        }

        if (ts.getConf() != null && ts.getConf().getFilterObject() != null) {
          if (LOG.isDebugEnabled()) {
            LOG.debug("Serializing: " + ts.getConf().getFilterObject());
          }

          ts.getConf().setSerializedFilterObject(
              SerializationUtilities.serializeObject(ts.getConf().getFilterObject()));
        }
      }
    }
SerializeFilter is a simple physical optimizer that serializes all filter expressions in
Tablescan Operators.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/SerializeFilter.java