{"record":{"id":"af7416a63b279bdf","repo":"prestodb/presto","slug":"rename-operation-is-not-supported-yet","errorCode":null,"errorMessage":"Rename operation is not supported yet","messagePattern":"Rename operation is not supported yet","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"presto-lark-sheets/src/main/java/com/facebook/presto/lark/sheets/api/LarkSheetsSchemaStore.java","lineNumber":28,"sourceCode":" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.facebook.presto.lark.sheets.api;\n\nimport java.util.Optional;\n\npublic interface LarkSheetsSchemaStore\n{\n    Optional<LarkSheetsSchema> get(String name);\n\n    void insert(LarkSheetsSchema schema);\n\n    void delete(String schemaName);\n\n    default void rename(String source, String target)\n    {\n        throw new UnsupportedOperationException(\"Rename operation is not supported yet\");\n    }\n\n    Iterable<LarkSheetsSchema> listForUser(String user);\n}\n","sourceCodeStart":10,"sourceCodeEnd":33,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-lark-sheets/src/main/java/com/facebook/presto/lark/sheets/api/LarkSheetsSchemaStore.java#L10-L33","documentation":"The LarkSheetsSchemaStore interface provides a default rename() that unconditionally throws UnsupportedOperationException. Rename is declared but not implemented, so any caller invoking rename on this store always fails.","triggerScenarios":"Calling rename(source, target) on LarkSheetsSchemaStore (or any store that doesn't override the default) — e.g. ALTER TABLE/SCHEMA RENAME flowing through the connector.","commonSituations":"Running ALTER TABLE ... RENAME TO against a lark-sheets table; tooling that renames schemas as part of migration.","solutions":["Do not use rename with this connector; drop and re-insert the schema/table under the new name instead.","Override rename(source, target) in a custom store implementation to implement the copy-then-delete logic.","Guard user-facing tooling to hide/disable rename operations for lark-sheets catalogs."],"exampleFix":"// before\nstore.rename(\"old\", \"new\");\n\n// after\nLarkSheetsSchema schema = /* fetch by source */;\nstore.insert(schema.withName(\"new\"));\nstore.delete(\"old\");","handlingStrategy":"fallback","validationCode":"// detect support before calling\nboolean renameSupported = !(store instanceof LarkSheetsSchemaStore) || hasRenameOverride(store);\n// simpler: feature-flag rename in tooling for lark-sheets catalogs","typeGuard":"boolean supportsRename(Object store) { try { return java.lang.reflect.Method.class.cast(store.getClass().getMethod(\"rename\", String.class, String.class)).getDeclaringClass() != LarkSheetsSchemaStore.class; } catch (NoSuchMethodException e) { return false; } }","tryCatchPattern":"try { store.rename(source, target); } catch (UnsupportedOperationException e) { copyThenDelete(store, source, target); }","preventionTips":["Disable rename UI/commands for lark-sheets catalogs.","Implement rename as insert-new + delete-old in migration scripts.","Check the store interface version for a future real rename implementation before enabling the feature."],"tags":["unsupported-operation","rename","presto"],"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"}