@Override
  public void run(HookContext hookContext) {
    if (hookContext.getHookType() == HookContext.HookType.POST_EXEC_HOOK) {
      SessionState.LogHelper console = SessionState.getConsole();
      if (console != null && !hookContext.getQueryPlan().isExplain()) {
        for (TaskRunner runner : hookContext.getCompleteTaskList()) {
          console.printError("RUN: " + runner.getTask());
        }
      }
    }
  }
List all tasks completed.

This is used to check tasks executed at runtime for queries containing conditional tasks
itests/util/src/main/java/org/apache/hadoop/hive/ql/hooks/PrintCompletedTasksHook.java