{"record":{"id":"8006bad52ba75c98","repo":"prestodb/presto","slug":"missing-catalog","errorCode":"MISSING_CATALOG","errorMessage":"Catalog '%s' does not exist","messagePattern":"Catalog '(.+?)' does not exist","errorType":"error_code","errorClass":"SemanticException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/execution/CreateMaterializedViewTask.java","lineNumber":99,"sourceCode":"    public CreateMaterializedViewTask(SqlParser sqlParser)\n    {\n        this.sqlParser = requireNonNull(sqlParser, \"sqlParser is null\");\n    }\n\n    @Override\n    public String getName()\n    {\n        return \"CREATE MATERIALIZED VIEW\";\n    }\n\n    @Override\n    public ListenableFuture<?> execute(CreateMaterializedView statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, Session session, List<Expression> parameters, WarningCollector warningCollector, String query)\n    {\n        QualifiedObjectName viewName = createQualifiedObjectName(session, statement, statement.getName(), metadata);\n        MetadataResolver metadataResolver = metadata.getMetadataResolver(session);\n\n        if (!metadataResolver.catalogExists(viewName.getCatalogName())) {\n            throw new SemanticException(MISSING_CATALOG, \"Catalog '%s' does not exist\", viewName.getCatalogName());\n        }\n\n        if (!metadataResolver.schemaExists(viewName.getCatalogSchemaName())) {\n            throw new SemanticException(MISSING_SCHEMA, statement, \"Schema '%s' does not exist\", viewName.getSchemaName());\n        }\n\n        Optional<TableHandle> viewHandle = metadataResolver.getTableHandle(viewName);\n        if (viewHandle.isPresent()) {\n            if (!statement.isNotExists()) {\n                throw new SemanticException(MATERIALIZED_VIEW_ALREADY_EXISTS, statement, \"Materialized view '%s' already exists\", viewName);\n            }\n            return immediateFuture(null);\n        }\n\n        accessControl.checkCanCreateTable(session.getRequiredTransactionId(), session.getIdentity(), session.getAccessControlContext(), viewName);\n        accessControl.checkCanCreateView(session.getRequiredTransactionId(), session.getIdentity(), session.getAccessControlContext(), viewName);\n\n        Map<NodeRef<Parameter>, Expression> parameterLookup = parameterExtractor(statement, parameters);","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/execution/CreateMaterializedViewTask.java#L81-L117","documentation":"CREATE MATERIALIZED VIEW targets a qualified name whose catalog does not exist. After deriving viewName via createQualifiedObjectName, the task verifies metadataResolver.catalogExists(viewName.getCatalogName()) and throws SemanticException MISSING_CATALOG when it fails.","triggerScenarios":"Running CREATE MATERIALIZED VIEW unknown_catalog.schema.name AS ... where the catalog name is mistyped or the connector/plugin is not deployed on the coordinator; catalog file missing from /etc/catalog so the catalog never registers.","commonSituations":"Typos in the catalog portion of the qualified name; environment drift where the catalog exists in dev but not prod; connector plugin not installed; catalog properties file misconfigured or removed after upgrade.","solutions":["Fix the catalog name in the statement (SHOW CATALOGS to list valid ones)","Install/deploy the missing connector and its properties file in /etc/catalog on the coordinator, then restart or wait for reload","Check environment: the catalog may exist in dev but not in the cluster you're targeting","Verify the plugin jar is present and the catalog registered in server logs"],"exampleFix":"// before\nCREATE MATERIALIZED VIEW hivemetastore.default.mv AS SELECT ...\n// after\nCREATE MATERIALIZED VIEW hive.default.mv AS SELECT ... -- catalog actually configured","handlingStrategy":"validation","validationCode":"// verify catalog exists before DDL\nSet<String> catalogs = fetch(\"SHOW CATALOGS\");\nif (!catalogs.contains(catalog)) {\n    throw new IllegalArgumentException(\"Catalog not found: \" + catalog);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run SHOW CATALOGS against each target environment before deploying DDL","Keep connector configs identical across environments (config-as-code)","Validate the fully-qualified name's catalog portion in tooling","Check coordinator logs for failed catalog registration after upgrades"],"tags":["catalog","missing-resource","materialized-view"],"backgroundTag":"catalog-does-not-exist","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"}