@Override
  public void run(HookContext hookContext) throws Exception {
    assert (hookContext.getHookType() == HookContext.HookType.POST_EXEC_HOOK);
    HiveConf conf = hookContext.getConf();

    LOG.info("Executing post execution hook to print orc file dump..");
    QueryPlan plan = hookContext.getQueryPlan();
    if (plan == null) {
      return;
    }

    FetchTask fetchTask = plan.getFetchTask();
    if (fetchTask != null) {
      SessionState ss = SessionState.get();
      SessionState.LogHelper console = ss.getConsole();

      // file dump should write to session state console's error stream
      PrintStream old = System.out;
      System.setOut(console.getErrStream());

      FetchWork fetchWork = fetchTask.getWork();
      boolean partitionedTable = fetchWork.isPartitioned();
      List<Path> directories;
      if (partitionedTable) {
        LOG.info("Printing orc file dump for files from partitioned directory..");
        directories = Lists.newArrayList(fetchWork.getPartDir());
      } else {
        LOG.info("Printing orc file dump for files from table directory..");
        directories = Lists.newArrayList(fetchWork.getTblDir());
      }

      Collections.sort(directories);
      for (Path dir : directories) {
        printFileStatus(console, dir.getFileSystem(conf), dir);
      }

      // restore the old out stream
      System.out.flush();
      System.setOut(old);
    }
  }
Post exec hook to print orc file dump for files that will be read by fetch task. The file dump
output will be printed before fetch task output. It also prints the row index for the 1st column
in the file just to verify the impact of bloom filter fpp.
ql/src/java/org/apache/hadoop/hive/ql/hooks/PostExecOrcFileDump.java