{"record":{"id":"4ba70a40fb5b5535","repo":"apache/iceberg","slug":"table-rename-operation-is-unsupported","errorCode":null,"errorMessage":"Table rename operation is unsupported.","messagePattern":"Table rename operation is unsupported\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreCatalog.java","lineNumber":185,"sourceCode":"      TableOperations ops = newTableOps(identifier);\n      TableMetadata lastMetadata = ops.current();\n\n      client.delete(toTableReference(identifier));\n\n      if (purge && lastMetadata != null) {\n        CatalogUtil.dropTableData(ops.io(), lastMetadata);\n      }\n    } catch (NoSuchTableException e) {\n      return false;\n    }\n\n    return true;\n  }\n\n  @Override\n  public void renameTable(TableIdentifier from, TableIdentifier to) {\n    // TODO: Enable once supported by BigQuery API.\n    throw new UnsupportedOperationException(\"Table rename operation is unsupported.\");\n  }\n\n  @Override\n  public void createNamespace(Namespace namespace, Map<String, String> metadata) {\n    Dataset builder = new Dataset();\n    DatasetReference datasetReference = toDatasetReference(namespace);\n    builder.setLocation(this.projectLocation);\n    builder.setDatasetReference(datasetReference);\n    builder.setExternalCatalogDatasetOptions(\n        BigQueryMetastoreUtils.createExternalCatalogDatasetOptions(\n            createDefaultStorageLocationUri(datasetReference.getDatasetId()), metadata));\n\n    client.create(builder);\n  }\n\n  @Override\n  public List<Namespace> listNamespaces() {\n    try {","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreCatalog.java#L167-L203","documentation":"Unconditional guard in BigQueryMetastoreCatalog.renameTable: the BigQuery API (at the time of writing, per the TODO) has no rename support, so every rename attempt is rejected up front. It is a permanent capability limitation of the catalog, independent of whether the source table exists.","triggerScenarios":"Any call to catalog.renameTable(from, to) on BigQueryMetastoreCatalog, e.g. via SQL ALTER TABLE ... RENAME TO routed through this catalog.","commonSituations":"Running ALTER TABLE RENAME or engine-level rename APIs against a BigQuery-backed Iceberg catalog; migration scripts assuming rename support.","solutions":["Drop the table and recreate it at the new identifier with the same schema/data location.","Use a different catalog that supports renames if renames are essential to your workflow.","Restructure tooling/scripts to avoid rename operations when using the BigQuery catalog."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (catalog instanceof BigQueryMetastoreCatalog) { throw new UnsupportedOperationException(\"Rename is not supported by BigQueryMetastoreCatalog\"); }","typeGuard":null,"tryCatchPattern":"try { catalog.renameTable(from, to); } catch (UnsupportedOperationException e) { // fall back to drop+create or surface to user\n}","preventionTips":["Feature-detect rename support before calling; the BigQuery catalog never supports it.","Replace rename workflows with drop-and-recreate.","Document catalog capability limitations for users running SQL engines."],"tags":["gcp","bigquery","unsupported-operation","catalog"],"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"}