private static void linkTasks(List<Task<?>> sources, Iterable<Task<?>> sinks) {
    for (Task<?> source : sources) {
      for (Task<?> sink : sinks) {
        source.addDependentTask(sink);
      }
    }
  }
Links tasks based on dependencies among CTEs which have actual tasks.
For example, when materialized CTE X depends on materialized CTE Y,
the leaf tasks of Y must have the root tasks of X as its child tasks.
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java