HyukjinKwon commented on a change in pull request #35246:
URL: https://github.com/apache/spark/pull/35246#discussion_r792675110



##########
File path: 
sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsNamespaces.java
##########
@@ -136,15 +137,20 @@ void alterNamespace(
       NamespaceChange... changes) throws NoSuchNamespaceException;
 
   /**
-   * Drop a namespace from the catalog, recursively dropping all objects 
within the namespace.
+   * Drop a namespace from the catalog with cascade mode, recursively dropping 
all objects
+   * within the namespace if cascade is true.
    * <p>
    * If the catalog implementation does not support this operation, it may 
throw
    * {@link UnsupportedOperationException}.
    *
    * @param namespace a multi-part namespace
+   * @param cascade When true, deletes all objects under the namespace
    * @return true if the namespace was dropped
    * @throws NoSuchNamespaceException If the namespace does not exist 
(optional)
+   * @throws NonEmptyNamespaceException If the namespace is non-empty and 
cascade is false
    * @throws UnsupportedOperationException If drop is not a supported operation
    */
-  boolean dropNamespace(String[] namespace) throws NoSuchNamespaceException;
+  boolean dropNamespace(
+      String[] namespace,
+      boolean cascade) throws NoSuchNamespaceException, 
NonEmptyNamespaceException;

Review comment:
       Can we at least keep the old signature, deprecate it and throw an 
exception? Also this PR changed the behaviour.
   
   I know that DSv2 has been less strict on this but probably we should start 
taking care about this given that the API has been almost 2 years since Spark 
3.0.0.




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