@Override
  public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs)
      throws SemanticException {
    GenTezProcContext context = (GenTezProcContext) procCtx;
    AppMasterEventOperator event = (AppMasterEventOperator) nd;
    DynamicPruningEventDesc desc = (DynamicPruningEventDesc) event.getConf();

    // simply need to remember that we've seen an event operator.
    context.eventOperatorSet.add(event);

    // and remember link between event and table scan
    List<AppMasterEventOperator> events;
    if (context.tsToEventMap.containsKey(desc.getTableScan())) {
      events = context.tsToEventMap.get(desc.getTableScan());
    } else {
      events = new ArrayList<AppMasterEventOperator>();
    }
    events.add(event);
    context.tsToEventMap.put(desc.getTableScan(), events);
    return true;
  }
FileSinkProcessor is a simple rule to remember seen unions for later
processing.
ql/src/java/org/apache/hadoop/hive/ql/parse/AppMasterEventProcessor.java