public static void setKeyAndValueDescForTaskTree(Task<?> task) {

    if (task instanceof ConditionalTask) {
      List<Task<?>> listTasks = ((ConditionalTask) task)
          .getListTasks();
      for (Task<?> tsk : listTasks) {
        setKeyAndValueDescForTaskTree(tsk);
      }
    } else if (task instanceof ExecDriver) {
      MapredWork work = (MapredWork) task.getWork();
      work.getMapWork().deriveExplainAttributes();
      Map<String, Operator<? extends OperatorDesc>> opMap = work.getMapWork().getAliasToWork();
      if (opMap != null && !opMap.isEmpty()) {
        for (Operator<? extends OperatorDesc> op : opMap.values()) {
          setKeyAndValueDesc(work.getReduceWork(), op);
        }
      }
    } else if (task != null && (task.getWork() instanceof TezWork)) {
      TezWork work = (TezWork)task.getWork();
      for (BaseWork w : work.getAllWorkUnsorted()) {
        if (w instanceof MapWork) {
          ((MapWork)w).deriveExplainAttributes();
        }
      }
    }

    if (task.getChildTasks() == null) {
      return;
    }

    for (Task<?> childTask : task.getChildTasks()) {
      setKeyAndValueDescForTaskTree(childTask);
    }
  }
Set the key and value description for all the tasks rooted at the given
task. Loops over all the tasks recursively.

@param task
ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java