imback82 commented on a change in pull request #26129: [SPARK-29482][SQL]
ANALYZE TABLE should look up catalog/table like v2 commands
URL: https://github.com/apache/spark/pull/26129#discussion_r335211160
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveSessionCatalog.scala
##########
@@ -265,6 +265,24 @@ class ResolveSessionCatalog(
// TODO (SPARK-29014): we should check if the current catalog is session
catalog here.
case ShowTablesStatement(None, pattern) if defaultCatalog.isEmpty =>
ShowTablesCommand(None, pattern)
+
+ case AnalyzeTableStatement(tableName, partitionSpec, noScan) =>
+ val CatalogAndIdentifierParts(catalog, parts) = tableName
+ if (!isSessionCatalog(catalog)) {
+ throw new AnalysisException("ANALYZE TABLE is only supported with v1
tables.")
+ }
Review comment:
Do you need to check `if (nameParts.length != 1)` simliar to
`ShowTablesStatement` above (line 259) if this is session catalog?
----------------------------------------------------------------
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]