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/03/07 13:53:47 UTC

[GitHub] [spark] viirya commented on a change in pull request #23915: [SPARK-24252][SQL] Add v2 catalog plugin system

viirya commented on a change in pull request #23915: [SPARK-24252][SQL] Add v2 catalog plugin system
URL: https://github.com/apache/spark/pull/23915#discussion_r263390845
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala
 ##########
 @@ -620,6 +622,12 @@ class SparkSession private(
    */
   @transient lazy val catalog: Catalog = new CatalogImpl(self)
 
+  @transient private lazy val catalogs = new mutable.HashMap[String, CatalogPlugin]()
+
+  private[sql] def catalog(name: String): CatalogPlugin = synchronized {
+    catalogs.getOrElseUpdate(name, Catalogs.load(name, sessionState.conf))
 
 Review comment:
   Possible case like loading a catalog plugin with different config? Currently it has to load it with a different catalog name. For example, like for a REST-based catalog endpoint, if it requires some authentication. We might want to reconnect the catalog with different authentication.

----------------------------------------------------------------
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