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



##########
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:
       We changed the implementation of `DropNamespaceExec` to not call 
`listTables` at the beginning, and the catalog implementation must deal with 
the `cascade` parameter properly. It's better to break binary compatibility 
here, instead of silently calling the old `dropNamespace` implementation which 
may drop all the tables in the 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.

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