{"record":{"id":"806016c815aa52a6","repo":"apache/iceberg","slug":"snowflakecatalog-does-not-currently-support-rename","errorCode":null,"errorMessage":"SnowflakeCatalog does not currently support renameTable","messagePattern":"SnowflakeCatalog does not currently support renameTable","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"warning","filePath":"snowflake/src/main/java/org/apache/iceberg/snowflake/SnowflakeCatalog.java","lineNumber":101,"sourceCode":"        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.\n      Class.forName(JdbcSnowflakeClient.EXPECTED_JDBC_IMPL);\n    } catch (ClassNotFoundException cnfe) {\n      LOG.warn(\n          \"Failed to load expected JDBC SnowflakeDriver - if queries fail by failing\"\n              + \" to find a suitable driver for jdbc:snowflake:// URIs, you must add the Snowflake \"\n              + \" JDBC driver to your jars/packages\",","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/snowflake/src/main/java/org/apache/iceberg/snowflake/SnowflakeCatalog.java#L83-L119","documentation":"Unconditional capability guard in SnowflakeCatalog.renameTable: tables live in Snowflake and renaming through this catalog is not implemented, so every call is rejected before contacting Snowflake. Use Snowflake-native DDL or recreate the table under the new identifier instead.","triggerScenarios":"Any invocation of catalog.renameTable(from, to) on SnowflakeCatalog, including Spark ALTER TABLE ... RENAME TO routed through the catalog.","commonSituations":"Generic table-management tooling that renames tables across catalogs; scripted migrations renaming tables; engines issuing RENAME operations against a SnowflakeCatalog.","solutions":["Perform the rename in Snowflake (ALTER ICEBERG TABLE ... RENAME TO) outside the catalog API","Skip rename operations for SnowflakeCatalog in generic tooling","Catch UnsupportedOperationException and fall back to a Snowflake-side rename"],"exampleFix":"// before\ncatalog.renameTable(from, to);\n// after\ntry {\n  catalog.renameTable(from, to);\n} catch (UnsupportedOperationException e) {\n  // perform rename via Snowflake SQL instead\n}","handlingStrategy":"try-catch","validationCode":"if (catalog instanceof SnowflakeCatalog) {\n  // perform rename in Snowflake instead\n}","typeGuard":"boolean supportsRenameTable(Catalog c) {\n  return !(c instanceof SnowflakeCatalog);\n}","tryCatchPattern":"try {\n  catalog.renameTable(from, to);\n} catch (UnsupportedOperationException e) {\n  // ALTER ICEBERG TABLE ... RENAME TO via Snowflake\n}","preventionTips":["Avoid rename workflows against SnowflakeCatalog","Centralize rename logic with per-catalog capability flags","Catch UnsupportedOperationException at the tool boundary","Prefer create+copy+verify over rename when Snowflake-side rename is unavailable"],"tags":["snowflake","unsupported-operation","catalog","rename-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"}