{"record":{"id":"8b9271afc11c1e1f","repo":"prestodb/presto","slug":"missing-catalog-8b9271","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/DropTableTask.java","lineNumber":56,"sourceCode":"import static com.google.common.util.concurrent.Futures.immediateFuture;\n\npublic class DropTableTask\n        implements DDLDefinitionTask<DropTable>\n{\n    @Override\n    public String getName()\n    {\n        return \"DROP TABLE\";\n    }\n\n    @Override\n    public ListenableFuture<?> execute(DropTable statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, Session session, List<Expression> parameters, WarningCollector warningCollector, String query)\n    {\n        QualifiedObjectName tableName = createQualifiedObjectName(session, statement, statement.getTableName(), metadata);\n        MetadataResolver metadataResolver = metadata.getMetadataResolver(session);\n\n        if (!metadataResolver.catalogExists(tableName.getCatalogName())) {\n            throw new SemanticException(MISSING_CATALOG, \"Catalog '%s' does not exist\", tableName.getCatalogName());\n        }\n\n        if (!metadataResolver.schemaExists(tableName.getCatalogSchemaName())) {\n            throw new SemanticException(MISSING_SCHEMA, statement, \"Schema '%s' does not exist\", tableName.getSchemaName());\n        }\n\n        Optional<TableHandle> tableHandle = metadataResolver.getTableHandle(tableName);\n        if (!tableHandle.isPresent()) {\n            if (!statement.isExists()) {\n                throw new SemanticException(MISSING_TABLE, statement, \"Table '%s' does not exist\", tableName);\n            }\n            return immediateFuture(null);\n        }\n\n        Optional<MaterializedViewDefinition> optionalMaterializedView = metadataResolver.getMaterializedView(tableName);\n        if (optionalMaterializedView.isPresent()) {\n            if (!statement.isExists()) {\n                throw new SemanticException(NOT_SUPPORTED, statement, \"'%s' is a materialized view, not a table. Use DROP MATERIALIZED VIEW to drop.\", tableName);","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/execution/DropTableTask.java#L38-L74","documentation":"Thrown by DropTableTask.execute when the catalog portion of the DROP TABLE target does not exist. Unlike the table check, this one throws even before consulting schemaExists, and it is a SemanticException raised unconditionally (no IF EXISTS bypass at this level).","triggerScenarios":"metadataResolver.catalogExists(tableName.getCatalogName()) returns false during DROP TABLE processing.","commonSituations":"Misspelled catalog; connector not configured on the cluster (missing etc/catalog properties file); cluster restart lost a catalog; script templating substituted an empty/wrong catalog variable.","solutions":["Run SHOW CATALOGS to see valid catalogs and fix the prefix.","Verify the connector properties file exists on the coordinator (etc/catalog/<name>.properties) and restart if you added it.","Check environment/config templating that generates the qualified table name."],"exampleFix":"// before\nDROP TABLE ${catalog}.default.events;\n// after\nDROP TABLE hive.default.events; -- ensure ${catalog} resolves to a deployed connector","handlingStrategy":"validation","validationCode":"// validate catalog before any DROP TABLE\nList<String> catalogs = query(\"SHOW CATALOGS\");\nif (!catalogs.contains(\"hive\")) {\n  throw new IllegalStateException(\"Catalog 'hive' not deployed on this cluster\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Health-check deployed catalogs at pipeline startup.","Keep catalog provisioning in infrastructure-as-code so names never drift.","Fail fast with a clear message when templated catalog names are empty/unknown."],"tags":["sql","catalog","configuration"],"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"}