HyukjinKwon commented on a change in pull request #26923: [SPARK-30284][SQL] 
CREATE VIEW should keep the current catalog and namespace
URL: https://github.com/apache/spark/pull/26923#discussion_r362370808
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/views.scala
 ##########
 @@ -158,12 +158,14 @@ case class CreateViewCommand(
       def verify(child: LogicalPlan) {
         child.collect {
           // Disallow creating permanent views based on temporary views.
-          case UnresolvedRelation(AsTableIdentifier(ident))
-            if sparkSession.sessionState.catalog.isTemporaryTable(ident) =>
-            // temporary views are only stored in the session catalog
-            throw new AnalysisException(s"Not allowed to create a permanent 
view $name by " +
-              s"referencing a temporary view $ident. " +
-              "Please create a temp view instead by CREATE TEMP VIEW")
+          case UnresolvedRelation(nameParts) if nameParts.length <= 2 =>
 
 Review comment:
   It's orthogonal with this PR but I find the name parts with length 
comparison very confusing, in particular, ever since DSv2 added the catalog 
APIs with multi name parts.

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


With regards,
Apache Git Services

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

Reply via email to