linhongliu-db commented on a change in pull request #33204:
URL: https://github.com/apache/spark/pull/33204#discussion_r663776384



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewSuite.scala
##########
@@ -910,4 +910,20 @@ abstract class SQLViewSuite extends QueryTest with 
SQLTestUtils {
       }
     }
   }
+
+  test("SPARK-18217: Disallow altering permanent views based on temporary 
views") {

Review comment:
       let's move this to `PersistedViewTestSuite`

##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/views.scala
##########
@@ -258,7 +258,9 @@ case class AlterViewAsCommand(
   def markAsAnalyzed(): LogicalPlan = copy(isAnalyzed = true)
 
   override def run(session: SparkSession): Seq[Row] = {
-    if (session.sessionState.catalog.isTempView(name)) {
+    val isTemporary = session.sessionState.catalog.isTempView(name)
+    verifyTemporaryObjectsNotExists(session.sessionState.catalog, isTemporary, 
name, query)

Review comment:
       there is a `verifyAutoGeneratedAliasesNotExists` in the latest master 
code. could you put them together?




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