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

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

commit 732a1211665dd11b4c55efb2c28a74ce480edd1c
Author: gavin9402 <[email protected]>
AuthorDate: Mon Apr 28 10:16:50 2025 +0800

    [core] Resolve hms Permission.NotAllow error (#5486)
---
 .../src/main/java/org/apache/paimon/hive/HiveCatalog.java           | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java
 
b/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java
index 1ef319fb31..c802e42cdd 100644
--- 
a/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java
+++ 
b/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java
@@ -1308,7 +1308,8 @@ public class HiveCatalog extends AbstractCatalog {
                 fileIO, new SerializableHiveConf(hiveConf), clientClassName, 
options, warehouse);
     }
 
-    public Table getHmsTable(Identifier identifier) throws 
TableNotExistException {
+    public Table getHmsTable(Identifier identifier)
+            throws TableNotExistException, TableNoPermissionException {
         try {
             return clients.run(
                     client ->
@@ -1317,6 +1318,9 @@ public class HiveCatalog extends AbstractCatalog {
         } catch (NoSuchObjectException e) {
             throw new TableNotExistException(identifier);
         } catch (TException e) {
+            if (e.getMessage().contains("Permission.NotAllow")) {
+                throw new TableNoPermissionException(identifier, e);
+            }
             throw new RuntimeException(
                     "Cannot determine if table " + identifier.getFullName() + 
" is a paimon table.",
                     e);

Reply via email to