You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/07/11 18:12:04 UTC

[GitHub] [spark] brkyvz commented on a change in pull request #25104: [SPARK-28341][SQL] remove session catalog config

brkyvz commented on a change in pull request #25104: [SPARK-28341][SQL] remove session catalog config
URL: https://github.com/apache/spark/pull/25104#discussion_r302674025
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalog/v2/LookupCatalog.scala
 ##########
 @@ -42,31 +37,15 @@ trait LookupCatalog extends Logging {
    * If this is None and a table's provider (source) is a v2 provider, the v2 session catalog will
    * be used.
    */
-  def defaultCatalog: Option[CatalogPlugin] = {
-    try {
-      defaultCatalogName.map(lookupCatalog)
-    } catch {
-      case NonFatal(e) =>
-        logError(s"Cannot load default v2 catalog: ${defaultCatalogName.get}", e)
-        None
-    }
-  }
+  def defaultCatalog: Option[CatalogPlugin] = catalogManager.getDefaultCatalog()
 
   /**
    * This catalog is a v2 catalog that delegates to the v1 session catalog. it is used when the
    * session catalog is responsible for an identifier, but the source requires the v2 catalog API.
    * This happens when the source implementation extends the v2 TableProvider API and is not listed
    * in the fallback configuration, spark.sql.sources.write.useV1SourceList
    */
-  def sessionCatalog: Option[CatalogPlugin] = {
-    try {
-      Some(lookupCatalog(SESSION_CATALOG_NAME))
-    } catch {
-      case NonFatal(e) =>
-        logError("Cannot load v2 session catalog", e)
-        None
-    }
-  }
+  def sessionCatalog: TableCatalog = catalogManager.v2SessionCatalog
 
 Review comment:
   The session catalog needs to be configurable. This is how custom data sources / table formats will plugin.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org