diff --git a/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/SparkCatalog.java b/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/SparkCatalog.java index f32b87603f44..8482a9107735 100644 --- a/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/SparkCatalog.java +++ b/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/SparkCatalog.java @@ -279,7 +279,9 @@ public org.apache.spark.sql.connector.catalog.Table alterTable( return loadTable(ident); } catch (Catalog.TableNotExistException e) { throw new NoSuchTableException(ident); - } catch (Catalog.ColumnAlreadyExistException | Catalog.ColumnNotExistException e) { + } catch (Catalog.ColumnAlreadyExistException + | Catalog.ColumnNotExistException + | Catalog.TableNoPermissionException e) { throw new RuntimeException(e); } } @@ -432,6 +434,8 @@ public void renameTable(Identifier oldIdent, Identifier newIdent) throw new NoSuchTableException(oldIdent); } catch (Catalog.TableAlreadyExistException e) { throw new TableAlreadyExistsException(newIdent); + } catch (Catalog.TableNoPermissionException e) { + throw new RuntimeException(String.format("Table %s no permission", oldIdent)); } } @@ -450,6 +454,8 @@ protected org.apache.spark.sql.connector.catalog.Table loadSparkTable( } } catch (Catalog.TableNotExistException e) { throw new NoSuchTableException(ident); + } catch (Catalog.TableNoPermissionException e) { + throw new RuntimeException(e); } } diff --git a/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/MigrateFileProcedure.java b/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/MigrateFileProcedure.java index 95d55df01178..576c733144ff 100644 --- a/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/MigrateFileProcedure.java +++ b/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/MigrateFileProcedure.java @@ -93,6 +93,8 @@ public InternalRow[] call(InternalRow args) { } catch (Catalog.TableNotExistException e) { throw new IllegalArgumentException( "Target paimon table does not exist: " + targetTable); + } catch (Catalog.TableNoPermissionException e) { + throw new IllegalArgumentException("Target paimon table no permission: " + targetTable); } try {