private void collectRealDependencies(CTEClause cte, LinkedHashSet<CTEClause> realDependencies) {
    for (CTEClause parent : cte.parents) {
      if (getRealTasks(parent) == null) {
        collectRealDependencies(parent, realDependencies);
      } else {
        realDependencies.add(parent);
      }
    }
  }
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