{"record":{"id":"c2661baacfe052b5","repo":"prestodb/presto","slug":"missing-catalog-c2661b","errorCode":"MISSING_CATALOG","errorMessage":"Target catalog '%s' does not exist","messagePattern":"Target catalog '(.+?)' does not exist","errorType":"error_code","errorClass":"SemanticException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/execution/RenameViewTask.java","lineNumber":61,"sourceCode":"    {\n        return \"RENAME VIEW\";\n    }\n\n    public ListenableFuture<?> execute(RenameView statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, Session session, List<Expression> parameters, WarningCollector warningCollector, String query)\n    {\n        QualifiedObjectName viewName = createQualifiedObjectName(session, statement, statement.getSource(), metadata);\n\n        Optional<ViewDefinition> view = metadata.getMetadataResolver(session).getView(viewName);\n        if (!view.isPresent()) {\n            if (!statement.isExists()) {\n                throw new SemanticException(MISSING_VIEW, statement, \"View '%s' does not exist\", viewName);\n            }\n            return immediateFuture(null);\n        }\n\n        QualifiedObjectName target = createQualifiedObjectName(session, statement, statement.getTarget(), metadata);\n        if (!metadata.getCatalogHandle(session, target.getCatalogName()).isPresent()) {\n            throw new SemanticException(MISSING_CATALOG, statement, \"Target catalog '%s' does not exist\", target.getCatalogName());\n        }\n        if (metadata.getMetadataResolver(session).getView(target).isPresent()) {\n            throw new SemanticException(VIEW_ALREADY_EXISTS, statement, \"Target view '%s' already exists\", target);\n        }\n        if (!viewName.getSchemaName().equals(target.getSchemaName())) {\n            throw new SemanticException(NOT_SUPPORTED, statement, \"View rename across schemas is not supported\");\n        }\n        if (!viewName.getCatalogName().equals(target.getCatalogName())) {\n            throw new SemanticException(NOT_SUPPORTED, statement, \"View rename across catalogs is not supported\");\n        }\n\n        accessControl.checkCanRenameView(session.getRequiredTransactionId(), session.getIdentity(), session.getAccessControlContext(), viewName, target);\n\n        metadata.renameView(session, viewName, target);\n\n        return immediateFuture(null);\n    }\n}","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/execution/RenameViewTask.java#L43-L79","documentation":"Validation in RenameViewTask.execute while resolving the ALTER VIEW ... RENAME target: the catalog portion of the target qualified name is not registered with this coordinator, so the renamed view could not be placed there.","triggerScenarios":"Thrown at presto-main-base/src/main/java/com/facebook/presto/execution/RenameViewTask.java:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the target catalog exists with SHOW CATALOGS and fix the spelling","Rename the view within its current catalog and schema","Create or mount the target catalog before retrying the rename"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}