private List<Task<?>> toRealRootTasks(LinkedHashMap<CTEClause, LinkedHashSet<CTEClause>> realDependencies) {
    List<Task<?>> realRootTasks = new ArrayList<>();
    for (CTEClause cte : realDependencies.keySet()) {
      if (realDependencies.get(cte).isEmpty()) {
        realRootTasks.addAll(getRealTasks(cte));
      }
    }
    return realRootTasks;
  }
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