private ExprNodeDesc generateInClauses(ExprNodeDesc predicate) throws SemanticException {
      Map<SemanticRule, SemanticNodeProcessor> exprRules = new LinkedHashMap<SemanticRule, SemanticNodeProcessor>();
      exprRules.put(new TypeRule(ExprNodeGenericFuncDesc.class), new StructInExprProcessor());

      // The dispatcher fires the processor corresponding to the closest matching
      // rule and passes the context along
      SemanticDispatcher disp = new DefaultRuleDispatcher(null, exprRules, null);
      SemanticGraphWalker egw = new PreOrderOnceWalker(disp);

      List<Node> startNodes = new ArrayList<Node>();
      startNodes.add(predicate);

      HashMap<Node, Object> outputMap = new HashMap<Node, Object>();
      egw.startWalking(startNodes, outputMap);
      return (ExprNodeDesc) outputMap.get(predicate);
    }
This optimization will take a Filter expression, and if its predicate contains
an IN operator whose children are constant structs or structs containing constant fields,
it will try to generate predicate with IN clauses containing only partition columns.
This predicate is in turn used by the partition pruner to prune the columns that are not
part of the original IN(STRUCT(..)..) predicate.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/PartitionColumnsSeparator.java