prestodb/presto · error · SemanticException

MISSING_CATALOG

MISSING_CATALOG

Error message

Catalog '%s' does not exist

What it means

Thrown by DropSchemaTask.execute when the catalog part of the qualified schema name does not exist in the server. This SemanticException fires before schema existence is evaluated, so a wrong catalog always reports MISSING_CATALOG rather than MISSING_SCHEMA.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/execution/DropSchemaTask.java:64

    @Override
    public String explain(DropSchema statement, List<Expression> parameters)
    {
        return "DROP SCHEMA " + statement.getSchemaName();
    }

    @Override
    public ListenableFuture<?> execute(DropSchema statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, Session session, List<Expression> parameters, WarningCollector warningCollector, String query)
    {
        if (statement.isCascade()) {
            throw new PrestoException(NOT_SUPPORTED, "CASCADE is not yet supported for DROP SCHEMA");
        }

        CatalogSchemaName schema = createCatalogSchemaName(session, statement, Optional.of(statement.getSchemaName()), metadata);
        MetadataResolver metadataResolver = metadata.getMetadataResolver(session);

        if (!metadataResolver.catalogExists(schema.getCatalogName())) {
            throw new SemanticException(MISSING_CATALOG, "Catalog '%s' does not exist", schema.getCatalogName());
        }

        if (!metadataResolver.schemaExists(schema)) {
            if (!statement.isExists()) {
                throw new SemanticException(MISSING_SCHEMA, statement, "Schema '%s' does not exist", schema);
            }
            return immediateFuture(null);
        }

        accessControl.checkCanDropSchema(session.getRequiredTransactionId(), session.getIdentity(), session.getAccessControlContext(), schema);

        metadata.dropSchema(session, schema);

        return immediateFuture(null);
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. List available catalogs: SHOW CATALOGS, and correct the catalog prefix in the statement.
  2. Check etc/catalog/*.properties on the coordinator — deploy the missing connector and restart.
  3. If IF EXISTS was expected to suppress this, note catalog-level checks throw regardless; fix the name instead.

Example fix

// before
DROP SCHEMA hivee.default.web_logs;
// after
DROP SCHEMA hive.default.web_logs;
Defensive patterns

Strategy: validation

Validate before calling

-- verify catalog exists before DDL
SHOW CATALOGS;
-- or client-side: SELECT * FROM system.metadata.catalogs WHERE catalog_name = 'hive';

Prevention

When it happens

Trigger: metadataResolver.catalogExists(schema.getCatalogName()) returns false for the catalog parsed from the DROP SCHEMA target, regardless of IF EXISTS.

Common situations: Typo in catalog name; connector plugin not deployed/restarted so catalog missing; catalog property file removed or misconfigured; environment differences (dev vs prod catalog names).

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/6f102cfbc2373f6c. Report an issue: GitHub.