@Override
  public Object process(Node nd, Stack<Node> stack,
                        NodeProcessorCtx procCtx, Object... nodeOutputs)
      throws SemanticException {

    GenTezProcContext context = (GenTezProcContext) procCtx;
    FileSinkOperator fileSink = (FileSinkOperator) nd;

    // just remember it for later processing
    context.fileSinkSet.add(fileSink);
    return true;
  }
FileSinkProcessor is a simple rule to remember seen file sinks for later
processing.
ql/src/java/org/apache/hadoop/hive/ql/parse/FileSinkProcessor.java