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 2021/03/22 19:18:34 UTC

[GitHub] [spark] imback82 commented on a change in pull request #31933: [WIP][SPARK-34701][SQL] Remove analyzing temp view again in CreateViewCommand

imback82 commented on a change in pull request #31933:
URL: https://github.com/apache/spark/pull/31933#discussion_r599008218



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/CacheTableExec.scala
##########
@@ -94,14 +94,19 @@ case class CacheTableAsSelectExec(
   override lazy val relationName: String = tempViewName
 
   override lazy val planToCache: LogicalPlan = {
+    // If the plan cannot be analyzed, throw an exception and don't proceed.
+    val qe = sparkSession.sessionState.executePlan(query)
+    qe.assertAnalyzed()
+    val analyzedPlan = qe.analyzed

Review comment:
       @cloud-fan If we make `query` as `child` of `CacheTableAsSelectExec`, it will be an optimized plan instead of an analyzed plan, which can be problematic when looking up the cached plan. One way to work around is to move matching `CacheTableAsSelect` back to `ResolveSessionCatalog`... Any thought?




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