{"record":{"id":"e889a2c174debdc5","repo":"apache/iceberg","slug":"snowflakecatalog-does-not-currently-support-dropna","errorCode":null,"errorMessage":"SnowflakeCatalog does not currently support dropNamespace","messagePattern":"SnowflakeCatalog does not currently support dropNamespace","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"warning","filePath":"snowflake/src/main/java/org/apache/iceberg/snowflake/SnowflakeCatalog.java","lineNumber":226,"sourceCode":"        namespaceExists = snowflakeClient.schemaExists(id);\n        break;\n      default:\n        throw new IllegalArgumentException(\n            String.format(\n                \"loadNamespaceMetadata must be at either DATABASE or SCHEMA level; got %s from namespace %s\",\n                id, namespace));\n    }\n    if (namespaceExists) {\n      return ImmutableMap.of();\n    } else {\n      throw new NoSuchNamespaceException(\n          \"Namespace '%s' with snowflake identifier '%s' doesn't exist\", namespace, id);\n    }\n  }\n\n  @Override\n  public boolean dropNamespace(Namespace namespace) {\n    throw new UnsupportedOperationException(\n        \"SnowflakeCatalog does not currently support dropNamespace\");\n  }\n\n  @Override\n  public boolean setProperties(Namespace namespace, Map<String, String> properties) {\n    throw new UnsupportedOperationException(\n        \"SnowflakeCatalog does not currently support setProperties\");\n  }\n\n  @Override\n  public boolean removeProperties(Namespace namespace, Set<String> properties) {\n    throw new UnsupportedOperationException(\n        \"SnowflakeCatalog does not currently support removeProperties\");\n  }\n\n  @Override\n  protected TableOperations newTableOps(TableIdentifier tableIdentifier) {\n    String fileIOImpl = DEFAULT_FILE_IO_IMPL;","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/snowflake/src/main/java/org/apache/iceberg/snowflake/SnowflakeCatalog.java#L208-L244","documentation":"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.","triggerScenarios":"Any invocation of catalog.dropNamespace(namespace) on SnowflakeCatalog, including engines or cleanup jobs that drop namespaces through the catalog API.","commonSituations":"Tear-down scripts dropping test namespaces generically across catalogs; tools assuming full namespace lifecycle support; environments cleaning up schemas after ETL runs.","solutions":["Drop the Snowflake database/schema via Snowflake SQL or the driver outside the catalog API","Skip dropNamespace calls for SnowflakeCatalog in generic cleanup tooling","Catch UnsupportedOperationException and fall back to Snowflake-side deletion"],"exampleFix":"// before\ncatalog.dropNamespace(Namespace.of(\"db\", \"schema\"));\n// after\ntry {\n  catalog.dropNamespace(Namespace.of(\"db\", \"schema\"));\n} catch (UnsupportedOperationException e) {\n  // execute DROP SCHEMA via Snowflake instead\n}","handlingStrategy":"try-catch","validationCode":"if (catalog instanceof SnowflakeCatalog) {\n  // drop database/schema via Snowflake SQL instead\n}","typeGuard":"boolean supportsDropNamespace(Catalog c) {\n  return !(c instanceof SnowflakeCatalog);\n}","tryCatchPattern":"try {\n  catalog.dropNamespace(ns);\n} catch (UnsupportedOperationException e) {\n  // DROP SCHEMA via Snowflake\n}","preventionTips":["Keep namespace deletion in Snowflake-side tooling","Gate generic cleanup jobs with catalog capability checks","Catch UnsupportedOperationException in cross-catalog tear-down code","Document SnowflakeCatalog as namespace read-only"],"tags":["snowflake","unsupported-operation","catalog","namespace"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}