apache/iceberg · warning · UnsupportedOperationException

SnowflakeCatalog does not currently support dropNamespace

Error message

SnowflakeCatalog does not currently support dropNamespace

What it means

Unconditional capability guard in SnowflakeCatalog.dropNamespace: dropping databases/schemas is not implemented for the Snowflake catalog, so the call always fails. Namespace lifecycle must be managed in Snowflake directly.

Source

Thrown at snowflake/src/main/java/org/apache/iceberg/snowflake/SnowflakeCatalog.java:226

        namespaceExists = snowflakeClient.schemaExists(id);
        break;
      default:
        throw new IllegalArgumentException(
            String.format(
                "loadNamespaceMetadata must be at either DATABASE or SCHEMA level; got %s from namespace %s",
                id, namespace));
    }
    if (namespaceExists) {
      return ImmutableMap.of();
    } else {
      throw new NoSuchNamespaceException(
          "Namespace '%s' with snowflake identifier '%s' doesn't exist", namespace, id);
    }
  }

  @Override
  public boolean dropNamespace(Namespace namespace) {
    throw new UnsupportedOperationException(
        "SnowflakeCatalog does not currently support dropNamespace");
  }

  @Override
  public boolean setProperties(Namespace namespace, Map<String, String> properties) {
    throw new UnsupportedOperationException(
        "SnowflakeCatalog does not currently support setProperties");
  }

  @Override
  public boolean removeProperties(Namespace namespace, Set<String> properties) {
    throw new UnsupportedOperationException(
        "SnowflakeCatalog does not currently support removeProperties");
  }

  @Override
  protected TableOperations newTableOps(TableIdentifier tableIdentifier) {
    String fileIOImpl = DEFAULT_FILE_IO_IMPL;

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Drop the Snowflake database/schema via Snowflake SQL or the driver outside the catalog API
  2. Skip dropNamespace calls for SnowflakeCatalog in generic cleanup tooling
  3. Catch UnsupportedOperationException and fall back to Snowflake-side deletion

Example fix

// before
catalog.dropNamespace(Namespace.of("db", "schema"));
// after
try {
  catalog.dropNamespace(Namespace.of("db", "schema"));
} catch (UnsupportedOperationException e) {
  // execute DROP SCHEMA via Snowflake instead
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (catalog instanceof SnowflakeCatalog) {
  // drop database/schema via Snowflake SQL instead
}

Type guard

boolean supportsDropNamespace(Catalog c) {
  return !(c instanceof SnowflakeCatalog);
}

Try / catch

try {
  catalog.dropNamespace(ns);
} catch (UnsupportedOperationException e) {
  // DROP SCHEMA via Snowflake
}

Prevention

When it happens

Trigger: Any invocation of catalog.dropNamespace(namespace) on SnowflakeCatalog, including engines or cleanup jobs that drop namespaces through the catalog API.

Common situations: Tear-down scripts dropping test namespaces generically across catalogs; tools assuming full namespace lifecycle support; environments cleaning up schemas after ETL runs.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/e889a2c174debdc5. Report an issue: GitHub.