okumin commented on code in PR #4363:
URL: https://github.com/apache/hive/pull/4363#discussion_r1207584190
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java:
##########
@@ -1440,47 +1443,78 @@ public String toString() {
}
}
- private List<Task<?>> toRealRootTasks(List<CTEClause> execution) {
- List<Task<?>> cteRoots = new ArrayList<>();
- List<Task<?>> cteLeafs = new ArrayList<>();
- List<Task<?>> curTopRoots = null;
Review Comment:
This looks like the root cause. In [the case I put in the
ticket](https://issues.apache.org/jira/browse/HIVE-24606), there are the
following dependencies.
- `<root> -> a1`
- `<root> -> x`
- `<root> -> a2`
- `a2 -> a1`
But the old implementation tries to traverse CTEs in order of `a1` -> `x` ->
`a2` -> `<root>`, following the appearance in the AST.
As a result, when it visits `a2`, the information of `a1` has gone and it
fails to link `a2` with `a1`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]