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



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/views.scala
##########
@@ -111,12 +111,11 @@ case class CreateViewCommand(
 
     // When creating a permanent view, not allowed to reference temporary 
objects.
     // This should be called after `qe.assertAnalyzed()` (i.e., `child` can be 
resolved)
-    verifyTemporaryObjectsNotExists(catalog, isTemporary, name, child)
+    verifyTemporaryObjectsNotExists(catalog, isTemporary, name, analyzedPlan)

Review comment:
       @cloud-fan if we remove `sparkSession.sessionState.executePlan(child)` 
and use `child` directly, do you think there would be an issue similar to 
`CacheTable` since `child` will be an optimized plan, not an analyzed plan? 




----------------------------------------------------------------
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:
us...@infra.apache.org



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

Reply via email to