@Override
  public void run(HookContext hookContext) throws Exception {
    assert(hookContext.getHookType() == HookType.PRE_EXEC_HOOK);
    SessionState ss = SessionState.get();
    QueryState queryState = hookContext.getQueryState();
    if (ss != null && ss.out instanceof FetchConverter) {
      boolean foundQuery = queryState.getHiveOperation() == HiveOperation.QUERY &&
              !hookContext.getQueryPlan().isForExplain();
      ((FetchConverter)ss.out).foundQuery(foundQuery);
    }

    Set<ReadEntity> inputs = hookContext.getInputs();
    Set<WriteEntity> outputs = hookContext.getOutputs();
    UserGroupInformation ugi = hookContext.getUgi();
    this.run(queryState,inputs,outputs,ugi);
  }
Implementation of a pre execute hook that simply prints out its parameters to
standard output.
ql/src/java/org/apache/hadoop/hive/ql/hooks/PreExecutePrinter.java