private LinkedHashMap<CTEClause, LinkedHashSet<CTEClause>> listRealDependencies() {
    LinkedHashMap<CTEClause, LinkedHashSet<CTEClause>> realDependencies = new LinkedHashMap<>();
    for (CTEClause child : rootClause.asExecutionOrder()) {
      if (getRealTasks(child) == null) {
        // This CTE will be executed as a part of other CTEs or a root statement
        continue;
      }
      LinkedHashSet<CTEClause> parents = new LinkedHashSet<>();
      collectRealDependencies(child, parents);
      realDependencies.put(child, parents);
    }
    return realDependencies;
  }
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