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



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -1129,9 +1139,12 @@ class Analyzer(override val catalogManager: 
CatalogManager)
           case other => other
         }
 
-        EliminateSubqueryAliases(relation) match {
-          case v: View =>
-            throw 
QueryCompilationErrors.insertIntoViewNotAllowedError(v.desc.identifier, table)
+        // Inserting into a file-based temporary view is allowed.
+        // (e.g., spark.read.parquet("path").createOrReplaceTempView("t").
+        // Thus, apply EliminateDataFrameTempViews rule to remove any 
dataframe temp views.
+        EliminateDataFrameTempViews(EliminateSubqueryAliases(relation)) match {

Review comment:
       we can probably add a `def getTempViewRawPlan` to avoid duplicated code.




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