You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/11/03 15:24:19 UTC

[GitHub] [spark] imback82 commented on a change in pull request #30229: [SPARK-33321][SQL] Migrate ANALYZE TABLE commands to use UnresolvedTableOrView to resolve the identifier

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/command/AnalyzePartitionCommand.scala
##########
@@ -75,6 +75,9 @@ case class AnalyzePartitionCommand(
 
   override def run(sparkSession: SparkSession): Seq[Row] = {
     val sessionState = sparkSession.sessionState
+    if (sessionState.catalog.getTempView(tableIdent.identifier).isDefined) {
+      throw new AnalysisException("ANALYZE TABLE is not supported on a temporary view.")
+    }

Review comment:
       OK. What if we want to support the scenario where a temp view is allowed but not a permanent view (not this PR)? Do we want something like the following?
   ```scala
   case class UnresolvedTableOrView(
       multipartIdentifier: Seq[String],
       allowTempView: Boolean = true,
       allowPermanentView: Boolean = true) extends LeafNode {
     require(allowTempView || allowPermanentView)
   }
   ```




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



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