cloud-fan commented on a change in pull request #26006: [SPARK-29279][SQL]
Merge SHOW NAMESPACES and SHOW DATABASES code path
URL: https://github.com/apache/spark/pull/26006#discussion_r332842678
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/LookupCatalog.scala
##########
@@ -84,38 +84,21 @@ private[sql] trait LookupCatalog extends Logging {
}
}
- type DefaultCatalogAndNamespace = (Option[CatalogPlugin], Seq[String])
-
- /**
- * Extract catalog and namespace from a multi-part identifier with the
default catalog if needed.
- * Catalog name takes precedence over namespaces.
- */
- object DefaultCatalogAndNamespace {
- def unapply(parts: Seq[String]): Some[DefaultCatalogAndNamespace] = parts
match {
- case Seq(catalogName, tail @ _*) =>
- try {
- Some((Some(catalogManager.catalog(catalogName)), tail))
- } catch {
- case _: CatalogNotFoundException =>
- Some((defaultCatalog, parts))
- }
- }
- }
-
- type CurrentCatalogAndNamespace = (CatalogPlugin, Seq[String])
+ type CatalogAndNamespace = (CatalogPlugin, Option[Seq[String]])
Review comment:
This is short, maybe we don't need the type alias.
----------------------------------------------------------------
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]