hililiwei commented on code in PR #4658:
URL: https://github.com/apache/iceberg/pull/4658#discussion_r866686968
##########
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:
If we encounter other exception while dropping the table, should we continue
to drop other tables, or should we abort the drop operation?
##########
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()
Review Comment:
Consider parallel operations using `Tasks` here?
--
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]