jzhuge commented on a change in pull request #24768: [SPARK-27919][SQL] Add v2 
session catalog
URL: https://github.com/apache/spark/pull/24768#discussion_r290395282
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalog/v2/LookupCatalog.scala
 ##########
 @@ -26,8 +28,17 @@ import org.apache.spark.sql.catalyst.TableIdentifier
 @Experimental
 trait LookupCatalog {
 
+  protected def defaultCatalogName: Option[String] = None
   protected def lookupCatalog(name: String): CatalogPlugin
 
+  lazy val defaultCatalog: Option[CatalogPlugin] = {
+    defaultCatalogName.flatMap(name => Try(lookupCatalog(name)).toOption)
 
 Review comment:
   Is it ok to suppress other exceptions than `CatalogNotFoundException`?
   Even for CatalogNotFoundException, how can we warn the user either default 
catalog name or default catalog plugin is misconfigured .

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

Reply via email to