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 2022/01/25 03:16:54 UTC
[GitHub] [spark] cloud-fan commented on a change in pull request #35271: [SPARK-37929][SQL][FOLLOWUP] Support cascade mode for JDBC V2
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org