cloud-fan commented on a change in pull request #25771: [SPARK-28970][SQL] 
Implement USE CATALOG/NAMESPACE for Data Source V2
URL: https://github.com/apache/spark/pull/25771#discussion_r329426978
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceResolution.scala
 ##########
 @@ -393,4 +404,15 @@ case class DataSourceResolution(
       nullable = true,
       builder.build())
   }
+
+  private def requireNamespaceExists(
+      catalog: CatalogPlugin,
+      namespace: Option[Seq[String]]): Unit = {
+    namespace.map { ns =>
+      val nsArray = ns.toArray
+      if (!catalog.asNamespaceCatalog.namespaceExists(nsArray)) {
 
 Review comment:
   This means that we can't set current namespace for a v2 catalog that doesn't 
implement `SupportsNamespace`.
   
   This is a little counter-intuitive as `TableCatalog.loadTable` does accept a 
namespace parameter. Maybe we shouldn't do the namespace check when setting 
current namespace.

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