{"record":{"id":"b4aaecfada509556","repo":"apache/iceberg","slug":"snowflakecatalog-does-not-currently-support-dropta","errorCode":null,"errorMessage":"SnowflakeCatalog does not currently support dropTable","messagePattern":"SnowflakeCatalog does not currently support dropTable","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"warning","filePath":"snowflake/src/main/java/org/apache/iceberg/snowflake/SnowflakeCatalog.java","lineNumber":95,"sourceCode":"  @Override\n  public List<TableIdentifier> listTables(Namespace namespace) {\n    SnowflakeIdentifier scope = NamespaceHelpers.toSnowflakeIdentifier(namespace);\n    Preconditions.checkArgument(\n        scope.type() == SnowflakeIdentifier.Type.SCHEMA,\n        \"listTables must be at SCHEMA level; got %s from namespace %s\",\n        scope,\n        namespace);\n\n    List<SnowflakeIdentifier> sfTables = snowflakeClient.listIcebergTables(scope);\n\n    return sfTables.stream()\n        .map(NamespaceHelpers::toIcebergTableIdentifier)\n        .collect(Collectors.toList());\n  }\n\n  @Override\n  public boolean dropTable(TableIdentifier identifier, boolean purge) {\n    throw new UnsupportedOperationException(\n        \"SnowflakeCatalog does not currently support dropTable\");\n  }\n\n  @Override\n  public void renameTable(TableIdentifier from, TableIdentifier to) {\n    throw new UnsupportedOperationException(\n        \"SnowflakeCatalog does not currently support renameTable\");\n  }\n\n  @Override\n  public void initialize(String name, Map<String, String> properties) {\n    String uri = properties.get(CatalogProperties.URI);\n    Preconditions.checkArgument(null != uri, \"JDBC connection URI is required\");\n    try {\n      // We'll ensure the expected JDBC driver implementation class is initialized through\n      // reflection regardless of which classloader ends up using this JdbcSnowflakeClient, but\n      // we'll only warn if the expected driver fails to load, since users may use repackaged or\n      // custom JDBC drivers for Snowflake communication.","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/snowflake/src/main/java/org/apache/iceberg/snowflake/SnowflakeCatalog.java#L77-L113","documentation":"SnowflakeCatalog.dropTable is unimplemented: Snowflake-managed Iceberg tables cannot be dropped through this catalog, so the method always throws UnsupportedOperationException. Dropping must be done on the Snowflake side (or via Snowflake SQL), not through the Iceberg catalog API.","triggerScenarios":"Any invocation of catalog.dropTable(identifier, purge) on a catalog initialized as SnowflakeCatalog, directly or via engines/tools that issue DROP TABLE through the catalog.","commonSituations":"Cleanup jobs that drop stale tables generically across catalogs; Spark 'DROP TABLE' statements routed through SnowflakeCatalog; migration scripts assuming full catalog write support.","solutions":["Drop the table in Snowflake (DROP ICEBERG TABLE) outside the Iceberg catalog API","Guard drop paths with a capability check or feature flag so this catalog is skipped","Wrap calls in try/catch for UnsupportedOperationException when writing catalog-agnostic code"],"exampleFix":"// before\ncatalog.dropTable(TableIdentifier.of(ns, \"tbl\"), false);\n// after\nif (catalog instanceof SnowflakeCatalog) {\n  // execute DROP ICEBERG TABLE via Snowflake instead\n} else {\n  catalog.dropTable(TableIdentifier.of(ns, \"tbl\"), false);\n}","handlingStrategy":"try-catch","validationCode":"if (catalog instanceof SnowflakeCatalog) {\n  // route drop to Snowflake SQL instead of catalog.dropTable\n}","typeGuard":"boolean supportsDropTable(Catalog c) {\n  return !(c instanceof SnowflakeCatalog);\n}","tryCatchPattern":"try {\n  catalog.dropTable(ident, false);\n} catch (UnsupportedOperationException e) {\n  // perform DROP ICEBERG TABLE via Snowflake\n}","preventionTips":["Treat SnowflakeCatalog as read-only for table lifecycle","Feature-detect supported operations before dispatching","Document unsupported operations in catalog wrapper layers","Route all mutations through Snowflake SQL for this catalog"],"tags":["snowflake","unsupported-operation","catalog","drop-table"],"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"}