brkyvz commented on a change in pull request #25104: [SPARK-28341][SQL] create
a public API for V2SessionCatalog
URL: https://github.com/apache/spark/pull/25104#discussion_r320911505
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalog/v2/CatalogManager.scala
##########
@@ -27,12 +27,18 @@ import org.apache.spark.sql.internal.SQLConf
* A thread-safe manager for [[CatalogPlugin]]s. It tracks all the registered
catalogs, and allow
* the caller to look up a catalog by name.
*/
-class CatalogManager(conf: SQLConf) extends Logging {
+class CatalogManager(conf: SQLConf, sessionCatalog: TableCatalog) extends
Logging {
private val catalogs = mutable.HashMap.empty[String, CatalogPlugin]
def catalog(name: String): CatalogPlugin = synchronized {
- catalogs.getOrElseUpdate(name, Catalogs.load(name, conf))
+ if (name.equalsIgnoreCase(CatalogManager.SESSION_CATALOG_NAME)) {
+ v2SessionCatalog.getOrElse {
+ throw new IllegalStateException("v2 session catalog not available")
Review comment:
why not `sessionCatalog`?
----------------------------------------------------------------
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]