You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/04/30 09:09:54 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #28407: [SPARK-31607][SQL] Improve the perf of CTESubstitution

cloud-fan commented on a change in pull request #28407:
URL: https://github.com/apache/spark/pull/28407#discussion_r417866931



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CTESubstitution.scala
##########
@@ -159,17 +146,36 @@ object CTESubstitution extends Rule[LogicalPlan] {
     }
   }
 
+  private def resolveCTERelations(
+      relations: Seq[(String, SubqueryAlias)],
+      isLegacy: Boolean): Seq[(String, LogicalPlan)] = {
+    val resolvedCTERelations = new mutable.ArrayBuffer[(String, LogicalPlan)](relations.size)
+    for ((name, relation) <- relations) {
+      val innerCTEResolved = if (isLegacy) {

Review comment:
       "resolved" here means the `With` is resolved inside this relation. The relation needs further processing to substitute `UnresolvedRelation` with the previous CTE relations.
   
   The naming is not very accurate when `legacy = true`, but this probably does matter.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org