cloud-fan commented on a change in pull request #35271:
URL: https://github.com/apache/spark/pull/35271#discussion_r791324763



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalog.scala
##########
@@ -282,12 +282,12 @@ class JDBCTableCatalog extends TableCatalog with 
SupportsNamespaces with Logging
       namespace: Array[String],
       cascade: Boolean): Boolean = namespace match {
     case Array(db) if namespaceExists(namespace) =>
-      if (listTables(Array(db)).nonEmpty) {
+      if (!cascade && listTables(Array(db)).nonEmpty) {

Review comment:
       `listTables` could be expensive. Can we try-catch the exception thrown 
by JDBC and detect the case when the schema/database is not empty?




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to