prestodb/presto · error · SemanticException

MISSING_COLUMN

MISSING_COLUMN

Error message

Column '%s' does not exist

What it means

AlterColumnNotNullTask looks up the column being altered among the table's handles; this fires when the named column does not exist in the table (and the statement lacked IF EXISTS/NOT NULL tolerance), raising MISSING_COLUMN_NAME.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/execution/AlterColumnNotNullTask.java:92

            return immediateFuture(null);
        }

        ConnectorId connectorId = metadata.getCatalogHandle(session, tableName.getCatalogName())
                .orElseThrow(() -> new PrestoException(NOT_FOUND, "Catalog does not exist: " + tableName.getCatalogName()));
        Set<ConnectorCapabilities> connectorCapabilities = metadata.getConnectorCapabilities(session, connectorId);
        if (!connectorCapabilities.contains(ALTER_COLUMN) || !connectorCapabilities.contains(NOT_NULL_COLUMN_CONSTRAINT)) {
            throw new SemanticException(NOT_SUPPORTED, statement, "Catalog %s does not support ALTER COLUMN with NOT NULL", connectorId.getCatalogName());
        }

        accessControl.checkCanAddConstraints(session.getRequiredTransactionId(), session.getIdentity(), session.getAccessControlContext(), tableName);

        TableHandle tableHandle = tableHandleOptional.get();
        String column = metadata.normalizeIdentifier(session, tableName.getCatalogName(), statement.getColumn().getValue());

        Map<String, ColumnHandle> columnHandles = metadata.getColumnHandles(session, tableHandle);
        ColumnHandle columnHandle = columnHandles.get(column);
        if (columnHandle == null) {
            throw new SemanticException(MISSING_COLUMN, statement, "Column '%s' does not exist", column);
        }

        if (metadata.getColumnMetadata(session, tableHandle, columnHandle).isHidden()) {
            throw new SemanticException(NOT_SUPPORTED, statement, "Cannot add/drop NOT NULL on hidden column");
        }

        if (statement.isDropConstraint()) {
            metadata.dropConstraint(session, tableHandle, Optional.empty(), Optional.of(column));
        }
        else {
            metadata.addConstraint(session, tableHandle, new NotNullConstraint(column));
        }

        return immediateFuture(null);
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Check the column name spelling
  2. List the table's columns to find the correct name
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at presto-main-base/src/main/java/com/facebook/presto/execution/AlterColumnNotNullTask.java:92 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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