cloud-fan commented on a change in pull request #26741: [SPARK-30104][SQL] Fix
catalog resolution for 'global_temp'
URL: https://github.com/apache/spark/pull/26741#discussion_r355842010
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveCatalogs.scala
##########
@@ -167,35 +169,36 @@ class ResolveCatalogs(val catalogManager: CatalogManager)
writeOptions = c.options.filterKeys(_ != "path"),
orCreate = c.orCreate)
- case DropTableStatement(NonSessionCatalog(catalog, tableName), ifExists,
_) =>
+ case DropTableStatement(NonSessionCatalogAndTable(catalog, tableName),
ifExists, _) =>
DropTable(catalog.asTableCatalog, tableName.asIdentifier, ifExists)
- case DropViewStatement(NonSessionCatalog(catalog, viewName), _) =>
+ case DropViewStatement(NonSessionCatalogAndTable(catalog, viewName), _) =>
throw new AnalysisException(
s"Can not specify catalog `${catalog.name}` for view
${viewName.quoted} " +
s"because view support in catalog has not been implemented yet")
- case c @ CreateNamespaceStatement(NonSessionCatalog(catalog, nameParts),
_, _) =>
+ case c @ CreateNamespaceStatement(NonSessionCatalogAndNamespace(catalog,
namespace), _, _) =>
CreateNamespace(
catalog.asNamespaceCatalog,
- nameParts,
+ namespace,
c.ifNotExists,
c.properties)
- case DropNamespaceStatement(NonSessionCatalog(catalog, nameParts),
ifExists, cascade) =>
- DropNamespace(catalog, nameParts, ifExists, cascade)
+ case DropNamespaceStatement(NonSessionCatalogAndNamespace(catalog, ns),
ifExists, cascade) =>
Review comment:
and also `tbl` instead of `tableName`, to make the code shorter.
----------------------------------------------------------------
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]