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



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/CacheTableExec.scala
##########
@@ -94,14 +94,21 @@ case class CacheTableAsSelectExec(
   override lazy val relationName: String = tempViewName
 
   override lazy val planToCache: LogicalPlan = {
+    // CacheTableAsSelectExec.query is not resolved yet (e.g., not a child of 
CacheTableAsSelect)
+    // in order to skip optimizing it; note that we need to pass an analyzed 
plan to
+    // CreateViewCommand for the cache to work correctly. Thus, the query is 
analyzed below.

Review comment:
       Can we further clean this up by creating `CreateViewStatement` instead 
of `CreateViewCommand` below?




-- 
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to