You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polaris.apache.org by yu...@apache.org on 2026/05/14 16:13:09 UTC

(polaris) branch main updated: Service: Move Iceberg request.validate() to the REST adapter (#4423)

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

flyrain pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git


The following commit(s) were added to refs/heads/main by this push:
     new 66fa7151e3 Service: Move Iceberg request.validate() to the REST adapter (#4423)
66fa7151e3 is described below

commit 66fa7151e375a3fbaa729b8813d34a8e7c8b0e99
Author: Yufei Gu <yu...@apache.org>
AuthorDate: Thu May 14 09:13:04 2026 -0700

    Service: Move Iceberg request.validate() to the REST adapter (#4423)
---
 .../apache/polaris/service/catalog/iceberg/CatalogHandlerUtils.java | 6 ------
 .../polaris/service/catalog/iceberg/IcebergCatalogAdapter.java      | 4 ++++
 .../polaris/service/catalog/iceberg/IcebergCatalogHandler.java      | 4 ----
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/CatalogHandlerUtils.java b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/CatalogHandlerUtils.java
index 68a9198161..46bc8e221e 100644
--- a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/CatalogHandlerUtils.java
+++ b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/CatalogHandlerUtils.java
@@ -231,8 +231,6 @@ public class CatalogHandlerUtils {
 
   public UpdateNamespacePropertiesResponse updateNamespaceProperties(
       SupportsNamespaces catalog, Namespace namespace, UpdateNamespacePropertiesRequest request) {
-    request.validate();
-
     Set<String> removals = Sets.newHashSet(request.removals());
     Map<String, String> updates = request.updates();
 
@@ -294,8 +292,6 @@ public class CatalogHandlerUtils {
 
   public LoadTableResponse registerTable(
       Catalog catalog, Namespace namespace, RegisterTableRequest request) {
-    request.validate();
-
     TableIdentifier identifier = TableIdentifier.of(namespace, request.name());
     Table table = catalog.registerTable(identifier, request.metadataLocation());
     if (table instanceof BaseTable baseTable) {
@@ -679,8 +675,6 @@ public class CatalogHandlerUtils {
 
   public LoadViewResponse createView(
       ViewCatalog catalog, Namespace namespace, CreateViewRequest request) {
-    request.validate();
-
     ViewBuilder viewBuilder =
         catalog
             .buildView(TableIdentifier.of(namespace, request.name()))
diff --git a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogAdapter.java b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogAdapter.java
index 5862f7cb91..9b4b11240e 100644
--- a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogAdapter.java
+++ b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogAdapter.java
@@ -232,6 +232,7 @@ public class IcebergCatalogAdapter
       UpdateNamespacePropertiesRequest updateNamespacePropertiesRequest,
       RealmContext realmContext,
       SecurityContext securityContext) {
+    updateNamespacePropertiesRequest.validate();
     validateIcebergProperties(realmConfig, updateNamespacePropertiesRequest.updates());
     Namespace ns =
         NamespaceUtils.splitNamespace(namespace, NamespaceUtils.DEFAULT_NAMESPACE_SEPARATOR);
@@ -264,6 +265,7 @@ public class IcebergCatalogAdapter
       String accessDelegationMode,
       RealmContext realmContext,
       SecurityContext securityContext) {
+    createTableRequest.validate();
     validateIcebergProperties(realmConfig, createTableRequest.properties());
     EnumSet<AccessDelegationMode> delegationModes =
         parseAccessDelegationModes(accessDelegationMode);
@@ -413,6 +415,7 @@ public class IcebergCatalogAdapter
       RegisterTableRequest registerTableRequest,
       RealmContext realmContext,
       SecurityContext securityContext) {
+    registerTableRequest.validate();
     Namespace ns =
         NamespaceUtils.splitNamespace(namespace, NamespaceUtils.DEFAULT_NAMESPACE_SEPARATOR);
     EntityNameValidator.validateIdentifier(TableIdentifier.of(ns, registerTableRequest.name()));
@@ -486,6 +489,7 @@ public class IcebergCatalogAdapter
       CreateViewRequest createViewRequest,
       RealmContext realmContext,
       SecurityContext securityContext) {
+    createViewRequest.validate();
     validateIcebergProperties(realmConfig, createViewRequest.properties());
 
     CreateViewRequest revisedRequest =
diff --git a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java
index 897d70bd59..575a0010ad 100644
--- a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java
+++ b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java
@@ -465,8 +465,6 @@ public abstract class IcebergCatalogHandler extends CatalogHandler implements Au
     authorizeCreateTableDirect(namespace, request, !delegationModes.isEmpty());
     Optional<AccessDelegationMode> resolvedMode = resolveAccessDelegationModes(delegationModes);
 
-    request.validate();
-
     TableIdentifier tableIdentifier = TableIdentifier.of(namespace, request.name());
     if (baseCatalog.tableExists(tableIdentifier)) {
       throw alreadyExistsExceptionForTableLikeEntity(
@@ -508,8 +506,6 @@ public abstract class IcebergCatalogHandler extends CatalogHandler implements Au
   }
 
   private TableMetadata stageTableCreateHelper(Namespace namespace, CreateTableRequest request) {
-    request.validate();
-
     TableIdentifier ident = TableIdentifier.of(namespace, request.name());
     if (baseCatalog.tableExists(ident)) {
       throw alreadyExistsExceptionForTableLikeEntity(ident, PolarisEntitySubType.ICEBERG_TABLE);