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/12/02 00:26:08 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #26476: [SPARK-29851][SQL] V2 catalog: Change default behavior of dropping namespace to cascade

HyukjinKwon commented on a change in pull request #26476: [SPARK-29851][SQL] V2 catalog: Change default behavior of dropping namespace to cascade
URL: https://github.com/apache/spark/pull/26476#discussion_r352386205
 
 

 ##########
 File path: sql/catalyst/src/test/scala/org/apache/spark/sql/connector/InMemoryTableCatalog.scala
 ##########
 @@ -181,9 +180,8 @@ class InMemoryTableCatalog extends BasicInMemoryTableCatalog with SupportsNamesp
   }
 
   override def dropNamespace(namespace: Array[String]): Boolean = {
-    if (listTables(namespace).nonEmpty) {
-      throw new IllegalStateException(s"Cannot delete non-empty namespace: ${namespace.quoted}")
-    }
+    listNamespaces(namespace).map(dropNamespace)
+    listTables(namespace).map(dropTable)
 
 Review comment:
   We should use `foreach` in such cases to avoid potential issues (see https://issues.apache.org/jira/browse/SPARK-16694)

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