{"record":{"id":"78e81c2985e618f9","repo":"prestodb/presto","slug":"not-supported-78e81c","errorCode":"NOT_SUPPORTED","errorMessage":"Table rename is not yet supported by Glue service","messagePattern":"Table rename is not yet supported by Glue service","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/glue/GlueHiveMetastore.java","lineNumber":851,"sourceCode":"                            .databaseName(databaseName)\n                            .tableInput(newTableInput.toBuilder().parameters(statisticsParameters).build())\n                            .build(),\n                    stats.getUpdateTable());\n\n            return EMPTY_RESULT;\n        }\n        catch (EntityNotFoundException e) {\n            throw new TableNotFoundException(new SchemaTableName(databaseName, tableName));\n        }\n        catch (AwsServiceException e) {\n            throw new PrestoException(HIVE_METASTORE_ERROR, e);\n        }\n    }\n\n    @Override\n    public MetastoreOperationResult renameTable(MetastoreContext metastoreContext, String databaseName, String tableName, String newDatabaseName, String newTableName)\n    {\n        throw new PrestoException(NOT_SUPPORTED, \"Table rename is not yet supported by Glue service\");\n    }\n\n    @Override\n    public MetastoreOperationResult addColumn(MetastoreContext metastoreContext, String databaseName, String tableName, String columnName, HiveType columnType, String columnComment)\n    {\n        software.amazon.awssdk.services.glue.model.Table table = getGlueTableOrElseThrow(databaseName, tableName);\n        ImmutableList.Builder<software.amazon.awssdk.services.glue.model.Column> newDataColumns = ImmutableList.builder();\n        newDataColumns.addAll(table.storageDescriptor().columns());\n        newDataColumns.add(convertColumn(new Column(columnName, columnType, Optional.ofNullable(columnComment), Optional.empty())));\n        StorageDescriptor newStorageDescriptor = table.storageDescriptor().toBuilder().columns(newDataColumns.build()).build();\n        replaceGlueTable(databaseName, tableName, table.toBuilder().storageDescriptor(newStorageDescriptor).build());\n        return EMPTY_RESULT;\n    }\n\n    @Override\n    public MetastoreOperationResult renameColumn(MetastoreContext metastoreContext, String databaseName, String tableName, String oldColumnName, String newColumnName)\n    {\n        software.amazon.awssdk.services.glue.model.Table table = getGlueTableOrElseThrow(databaseName, tableName);","sourceCodeStart":833,"sourceCodeEnd":869,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/glue/GlueHiveMetastore.java#L833-L869","documentation":"GlueHiveMetastore.renameTable unconditionally throws NOT_SUPPORTED because the AWS Glue Data Catalog API does not expose a table rename operation (a Glue table is keyed by database+name, and renaming requires create+delete which could lose state). This is a hard capability gap of the backend, not a validation failure in Presto.","triggerScenarios":"ALTER TABLE ... RENAME TO or any call to Metastore.renameTable on a table stored in the Glue Data Catalog; migration tooling calling renameTable to move a table between Glue databases.","commonSituations":"Users migrating from Hive metastore (where rename works) to Glue; CI/CD pipelines that rename tables as part of blue/green deployments; cross-database table moves assumed to be supported.","solutions":["Use CREATE TABLE ... AS SELECT (or CREATE TABLE LIKE + INSERT) into the new table name, then drop the old table.","Use external tooling (AWS CLI/Glue console/UpdateTable + CreateTable/DeleteTable) to perform create-new, copy-data, drop-old explicitly.","Restructure the workflow to avoid renames — e.g. write directly to the final table name.","If only the location/schema changed, consider Glue UpdateTable instead of a rename."],"exampleFix":"// before\nmetastore.renameTable(context, \"db\", \"old_t\", \"db\", \"new_t\"); // throws on Glue\n// after\n// CREATE TABLE db.new_t AS SELECT * FROM db.old_t; then DROP TABLE db.old_t;\nrunner.executeSessionSql(\"CREATE TABLE db.new_t AS SELECT * FROM db.old_t\");\nrunner.executeSessionSql(\"DROP TABLE db.old_t\");","handlingStrategy":"fallback","validationCode":"// Feature-check the backend capability before planning a rename:\n// if the metastore is GlueHiveMetastore (or backend is 'glue'), treat renameTable as unavailable.","typeGuard":"boolean supportsTableRename = !(metastore instanceof GlueHiveMetastore);\nif (!supportsTableRename) { useCtasFallback(db, oldTable, newTable); }","tryCatchPattern":"try {\n    metastore.renameTable(ctx, db, oldName, db, newName);\n}\ncatch (PrestoException e) {\n    if (e.getErrorCode().getName().equals(\"NOT_SUPPORTED\")) {\n        ctasThenDrop(db, oldName, newName); // CREATE TABLE new AS SELECT + DROP old\n    } else { throw e; }\n}","preventionTips":["Do not build rename-based deployment flows on Glue-backed tables.","Use CTAS + DROP as the portable rename fallback for all backends.","Document backend capability differences (file/Hive metastore vs Glue) in tooling."],"tags":["glue","not-supported","rename","aws"],"backgroundTag":"operation-not-supported","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}