stczwd commented on a change in pull request #35653:
URL: https://github.com/apache/spark/pull/35653#discussion_r815866254



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/views.scala
##########
@@ -614,7 +614,11 @@ object ViewHelper extends SQLConfHelper with Logging {
     }.getOrElse(false)
     if (replace && uncache) {
       logDebug(s"Try to uncache ${name.quotedString} before replacing.")
-      checkCyclicViewReference(analyzedPlan, Seq(name), name)

Review comment:
       Maybe removing this check and removing the SubqueryAlias and View from 
analyzedPlan is a better idea for this condition. Same with 
[here](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/command/views.scala#L149).
   However, it depends on whether we support user to repalce view in this way.

##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewTestSuite.scala
##########
@@ -443,6 +468,9 @@ class LocalTempViewTestSuite extends TempViewTestSuite with 
SharedSparkSession {
   override protected def tableIdentifier(viewName: String): TableIdentifier = {
     TableIdentifier(viewName)
   }
+  override def createDatasetView(df: DataFrame, viewName: String): Unit = {

Review comment:
       nit: use `createOrReplaceDatasetView` instead of `createDatasetView`.




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

To unsubscribe, e-mail: [email protected]

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