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

snazy 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 ed7436821d Remove unused functions from CatalogHandlerUtils (#3782)
ed7436821d is described below

commit ed7436821d1c439ebb38ea6140ee02cc19959a2c
Author: Robert Stupp <[email protected]>
AuthorDate: Wed Feb 18 19:16:05 2026 +0100

    Remove unused functions from CatalogHandlerUtils (#3782)
---
 .../catalog/iceberg/CatalogHandlerUtils.java       | 64 ----------------------
 1 file changed, 64 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 6a189bceac..2de9006cd6 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
@@ -24,14 +24,11 @@ import static 
org.apache.iceberg.TableProperties.COMMIT_TOTAL_RETRY_TIME_MS_DEFA
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
-import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
 import jakarta.annotation.Nullable;
 import jakarta.enterprise.context.ApplicationScoped;
 import jakarta.inject.Inject;
 import java.lang.reflect.Field;
-import java.time.OffsetDateTime;
-import java.time.ZoneOffset;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.LinkedHashSet;
@@ -48,11 +45,9 @@ import org.apache.iceberg.BaseTransaction;
 import org.apache.iceberg.DataOperations;
 import org.apache.iceberg.MetadataUpdate;
 import org.apache.iceberg.MetadataUpdate.UpgradeFormatVersion;
-import org.apache.iceberg.PartitionSpec;
 import org.apache.iceberg.Schema;
 import org.apache.iceberg.Snapshot;
 import org.apache.iceberg.SnapshotRef;
-import org.apache.iceberg.SortOrder;
 import org.apache.iceberg.Table;
 import org.apache.iceberg.TableMetadata;
 import org.apache.iceberg.TableOperations;
@@ -63,7 +58,6 @@ import org.apache.iceberg.catalog.Namespace;
 import org.apache.iceberg.catalog.SupportsNamespaces;
 import org.apache.iceberg.catalog.TableIdentifier;
 import org.apache.iceberg.catalog.ViewCatalog;
-import org.apache.iceberg.exceptions.AlreadyExistsException;
 import org.apache.iceberg.exceptions.CommitFailedException;
 import org.apache.iceberg.exceptions.NoSuchNamespaceException;
 import org.apache.iceberg.exceptions.NoSuchTableException;
@@ -220,12 +214,6 @@ public class CatalogHandlerUtils {
         .build();
   }
 
-  public void namespaceExists(SupportsNamespaces catalog, Namespace namespace) 
{
-    if (!catalog.namespaceExists(namespace)) {
-      throw new NoSuchNamespaceException("Namespace does not exist: %s", 
namespace);
-    }
-  }
-
   public GetNamespaceResponse loadNamespace(SupportsNamespaces catalog, 
Namespace namespace) {
     Map<String, String> properties = catalog.loadNamespaceMetadata(namespace);
     return GetNamespaceResponse.builder()
@@ -281,45 +269,6 @@ public class CatalogHandlerUtils {
     return 
ListTablesResponse.builder().addAll(page.first()).nextPageToken(page.second()).build();
   }
 
-  public LoadTableResponse stageTableCreate(
-      Catalog catalog, Namespace namespace, CreateTableRequest request) {
-    request.validate();
-
-    TableIdentifier ident = TableIdentifier.of(namespace, request.name());
-    if (catalog.tableExists(ident)) {
-      throw new AlreadyExistsException("Table already exists: %s", ident);
-    }
-
-    Map<String, String> properties = Maps.newHashMap();
-    properties.put("created-at", 
OffsetDateTime.now(ZoneOffset.UTC).toString());
-    properties.putAll(request.properties());
-
-    String location;
-    if (request.location() != null) {
-      location = request.location();
-    } else {
-      location =
-          catalog
-              .buildTable(ident, request.schema())
-              .withPartitionSpec(request.spec())
-              .withSortOrder(request.writeOrder())
-              .withProperties(properties)
-              .createTransaction()
-              .table()
-              .location();
-    }
-
-    TableMetadata metadata =
-        TableMetadata.newTableMetadata(
-            request.schema(),
-            request.spec() != null ? request.spec() : 
PartitionSpec.unpartitioned(),
-            request.writeOrder() != null ? request.writeOrder() : 
SortOrder.unsorted(),
-            location,
-            properties);
-
-    return LoadTableResponse.builder().withTableMetadata(metadata).build();
-  }
-
   public LoadTableResponse createTable(
       Catalog catalog, Namespace namespace, CreateTableRequest request) {
     request.validate();
@@ -372,13 +321,6 @@ public class CatalogHandlerUtils {
     }
   }
 
-  public void tableExists(Catalog catalog, TableIdentifier ident) {
-    boolean exists = catalog.tableExists(ident);
-    if (!exists) {
-      throw new NoSuchTableException("Table does not exist: %s", ident);
-    }
-  }
-
   public LoadTableResponse loadTable(Catalog catalog, TableIdentifier ident) {
     Table table = catalog.loadTable(ident);
 
@@ -777,12 +719,6 @@ public class CatalogHandlerUtils {
         .build();
   }
 
-  public void viewExists(ViewCatalog catalog, TableIdentifier viewIdentifier) {
-    if (!catalog.viewExists(viewIdentifier)) {
-      throw new NoSuchViewException("View does not exist: %s", viewIdentifier);
-    }
-  }
-
   public LoadViewResponse loadView(ViewCatalog catalog, TableIdentifier 
viewIdentifier) {
     View view = catalog.loadView(viewIdentifier);
     return viewResponse(view);

Reply via email to