public void run(QueryState queryState, Set<ReadEntity> inputs,
      Set<WriteEntity> outputs, LineageInfo linfo,
      UserGroupInformation ugi) throws Exception {

    LogHelper console = SessionState.getConsole();

    if (console == null) {
      return;
    }

    if (queryState != null) {
      console.printInfo("POSTHOOK: query: " + queryState.getQueryString().trim(), false);
      console.printInfo("POSTHOOK: type: " + queryState.getCommandType(), false);
    }

    PreExecutePrinter.printEntities(console, inputs, "POSTHOOK: Input: ");
    PreExecutePrinter.printEntities(console, outputs, "POSTHOOK: Output: ");

    // Also print out the generic lineage information if there is any
    if (linfo != null) {
      LinkedList<Map.Entry<DependencyKey, Dependency>> entry_list =
        new LinkedList<Map.Entry<DependencyKey, Dependency>>(linfo.entrySet());
      Collections.sort(entry_list, new DependencyKeyComp());
      Iterator<Map.Entry<DependencyKey, Dependency>> iter = entry_list.iterator();
      while(iter.hasNext()) {
        Map.Entry<DependencyKey, Dependency> it = iter.next();
        Dependency dep = it.getValue();
        DependencyKey depK = it.getKey();

        if(dep == null) {
          continue;
        }

        StringBuilder sb = new StringBuilder();
        sb.append("POSTHOOK: Lineage: ");
        if (depK.getDataContainer().isPartition()) {
          Partition part = depK.getDataContainer().getPartition();
          sb.append(part.getTableName());
          sb.append(" PARTITION(");
          int i = 0;
          for (FieldSchema fs : depK.getDataContainer().getTable().getPartitionKeys()) {
            if (i != 0) {
              sb.append(",");
            }
            sb.append(fs.getName() + "=" + part.getValues().get(i++));
          }
          sb.append(")");
        }
        else {
          sb.append(depK.getDataContainer().getTable().getTableName());
        }
        sb.append("." + depK.getFieldSchema().getName() + " " +
            dep.getType() + " ");

        sb.append("[");
        for(BaseColumnInfo col: dep.getBaseCols()) {
          sb.append("("+col.getTabAlias().getTable().getTableName() + ")"
              + col.getTabAlias().getAlias() + "."
              + col.getColumn() + ", ");
        }
        sb.append("]");

        console.printInfo(sb.toString(), false);
      }
    }
  }
Implementation of a post execute hook that simply prints out its parameters
to standard output.
ql/src/java/org/apache/hadoop/hive/ql/hooks/PostExecutePrinter.java