HyukjinKwon commented on a change in pull request #35246:
URL: https://github.com/apache/spark/pull/35246#discussion_r792620857
##########
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 implement default method of `dropNamespace(String[] namespace)`
that calls `dropNamespace(namespace, cascade = false)` or
`dropNamespace(namespace, cascade = true)` with deprecating and pointing the
alternative? It already used to work with cascading before, and that's what we
documented. This API was added from Spark 3.0.0, and I don't think we should
break this binary compatibility unless we must.
--
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]