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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]