hililiwei commented on code in PR #4658:
URL: https://github.com/apache/iceberg/pull/4658#discussion_r867317264


##########
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java:
##########
@@ -229,6 +229,20 @@ public void dropDatabase(String name, boolean 
ignoreIfNotExists, boolean cascade
       throws DatabaseNotExistException, DatabaseNotEmptyException, 
CatalogException {
     if (asNamespaceCatalog != null) {
       try {
+        if (cascade) {
+          List<ObjectPath> deleteTablePaths = 
icebergCatalog.listTables(toNamespace(name)).stream()
+                  .map(s -> ObjectPath.fromString(s.toString()))
+                  .collect(Collectors.toList());
+          deleteTablePaths.forEach(
+                  objectPath -> {
+                    try {
+                      dropTable(objectPath, true);
+                    } catch (TableNotExistException ex) {

Review Comment:
   Is it possible to get an exception other than `TableNotExistException`?



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