This is an automated email from the ASF dual-hosted git repository.

lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git


The following commit(s) were added to refs/heads/master by this push:
     new dcc67aaf66 [core] add checker for rename table operation and drop 
table operation. (#5806)
dcc67aaf66 is described below

commit dcc67aaf662fb34e21e9bfe04d2d1bc963ffeb9f
Author: zhoulii <[email protected]>
AuthorDate: Fri Jun 27 15:43:16 2025 +0800

    [core] add checker for rename table operation and drop table operation. 
(#5806)
---
 .../java/org/apache/paimon/catalog/FileSystemCatalog.java   | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git 
a/paimon-core/src/main/java/org/apache/paimon/catalog/FileSystemCatalog.java 
b/paimon-core/src/main/java/org/apache/paimon/catalog/FileSystemCatalog.java
index 588c801bf8..da56253335 100644
--- a/paimon-core/src/main/java/org/apache/paimon/catalog/FileSystemCatalog.java
+++ b/paimon-core/src/main/java/org/apache/paimon/catalog/FileSystemCatalog.java
@@ -90,7 +90,13 @@ public class FileSystemCatalog extends AbstractCatalog {
 
     @Override
     protected void dropDatabaseImpl(String name) {
-        uncheck(() -> fileIO.delete(newDatabasePath(name), true));
+        Path databasePath = newDatabasePath(name);
+        if (!uncheck(() -> fileIO.delete(databasePath, true))) {
+            throw new RuntimeException(
+                    String.format(
+                            "Delete database failed, " + "database: %s, 
location: %s",
+                            name, databasePath));
+        }
     }
 
     @Override
@@ -152,7 +158,10 @@ public class FileSystemCatalog extends AbstractCatalog {
     public void renameTableImpl(Identifier fromTable, Identifier toTable) {
         Path fromPath = getTableLocation(fromTable);
         Path toPath = getTableLocation(toTable);
-        uncheck(() -> fileIO.rename(fromPath, toPath));
+        if (!uncheck(() -> fileIO.rename(fromPath, toPath))) {
+            throw new RuntimeException(
+                    String.format("Failed to rename table %s to table %s.", 
fromTable, toTable));
+        }
     }
 
     @Override

Reply via email to