Skip to content

Commit b022e35

Browse files
committed
update comments
1 parent c906218 commit b022e35

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CTESubstitution.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,12 @@ object CTESubstitution extends Rule[LogicalPlan] {
152152
val resolvedCTERelations = new mutable.ArrayBuffer[(String, LogicalPlan)](relations.size)
153153
for ((name, relation) <- relations) {
154154
val innerCTEResolved = if (isLegacy) {
155-
// In legacy mode, outer CTE relations take precedence, so substitute relations later.
155+
// In legacy mode, outer CTE relations take precedence. Here we don't resolve the inner
156+
// `With` nodes, later we will substitute `UnresolvedRelation`s with outer CTE relations.
157+
// Analyzer will run this rule multiple times until all `With` nodes are resolved.
156158
relation
157159
} else {
158-
// A CTE definition might contain an inner CTE that has priority, so traverse and
160+
// A CTE definition might contain an inner CTE that has a higher priority, so traverse and
159161
// substitute CTE defined in `relation` first.
160162
traverseAndSubstituteCTE(relation)
161163
}

0 commit comments

Comments
 (0)