prestodb/presto · error · SemanticException

NOT_SUPPORTED

NOT_SUPPORTED

Error message

Catalog '%s' does not support non-null column for column name '%s'

What it means

CREATE TABLE was issued with a NOT NULL column, but the target catalog's connector does not advertise the NOT_NULL_COLUMN_CONSTRAINT capability. Presto rejects the statement up front rather than silently dropping the constraint. This is a connector capability check in CreateTableTask.internalExecute, not a data error.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/execution/CreateTableTask.java:142

            if (element instanceof ColumnDefinition) {
                ColumnDefinition column = (ColumnDefinition) element;
                String columnName = column.getName().getValue();
                String name = metadata.normalizeIdentifier(session, tableName.getCatalogName(), columnName);
                Type type;
                try {
                    type = metadata.getType(parseTypeSignature(column.getType()));
                }
                catch (IllegalArgumentException | UnknownTypeException e) {
                    throw new SemanticException(TYPE_MISMATCH, element, "Unknown type '%s' for column '%s'", column.getType(), column.getName());
                }
                if (type.equals(UNKNOWN)) {
                    throw new SemanticException(TYPE_MISMATCH, element, "Unknown type '%s' for column '%s'", column.getType(), column.getName());
                }
                if (columns.containsKey(name)) {
                    throw new SemanticException(DUPLICATE_COLUMN_NAME, column, "Column name '%s' specified more than once", column.getName());
                }
                if (!column.isNullable() && !metadata.getConnectorCapabilities(session, connectorId).contains(NOT_NULL_COLUMN_CONSTRAINT)) {
                    throw new SemanticException(NOT_SUPPORTED, column, "Catalog '%s' does not support non-null column for column name '%s'", connectorId.getCatalogName(), column.getName());
                }

                Map<String, Expression> sqlProperties = mapFromProperties(column.getProperties());
                Map<String, Object> columnProperties = metadata.getColumnPropertyManager().getProperties(
                        connectorId,
                        tableName.getCatalogName(),
                        sqlProperties,
                        session,
                        metadata,
                        parameterLookup);

                columns.put(name, ColumnMetadata.builder()
                        .setName(name)
                        .setType(type)
                        .setNullable(column.isNullable())
                        .setComment(column.getComment().orElse(null))
                        .setProperties(columnProperties)
                        .build());

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Remove the NOT NULL qualifier from the column definition for that catalog.
  2. Use a catalog whose connector supports NOT_NULL_COLUMN_CONSTRAINT (e.g. Iceberg).
  3. Upgrade or patch the connector to implement and declare NOT_NULL_COLUMN_CONSTRAINT.
  4. Enforce non-null semantics downstream (e.g. via a constraint or ETL validation) instead of in the catalog.

Example fix

// before
CREATE TABLE t (id BIGINT NOT NULL, name VARCHAR);
// after
CREATE TABLE t (id BIGINT, name VARCHAR); -- catalog does not support NOT NULL
Defensive patterns

Strategy: validation

Validate before calling

Set<ConnectorCapability> caps = metadata.getConnectorCapabilities(session, connectorId);
if (!caps.contains(NOT_NULL_COLUMN_CONSTRAINT)) {
    // strip NOT NULL from column definitions or pick another catalog before running CREATE TABLE
}

Type guard

boolean supportsNotNull(Session session, CatalogName catalog) {
    return metadata.getConnectorCapabilities(session, catalog).contains(NOT_NULL_COLUMN_CONSTRAINT);
}

Try / catch

try {
    future = createTableTask.execute(statement, ...);
} catch (SemanticException e) {
    if (e.getCode() == NOT_SUPPORTED) {
        // rewrite DDL without NOT NULL or switch catalog
    }
}

Prevention

When it happens

Trigger: Executing CREATE TABLE (or CREATE TABLE AS with a column definition) where any ColumnDefinition has nullable=false and metadata.getConnectorCapabilities(session, connectorId) does not contain NOT_NULL_COLUMN_CONSTRAINT.

Common situations: Creating NOT NULL columns against connectors that never implemented null enforcement (e.g. older Hive/Redis/Mongo connectors); SQL ported from engines like MySQL/PostgreSQL/Oracle where NOT NULL is standard; switching a query to a different catalog that lacks the capability.

Understand the failure class

Background: Presto NOT_SUPPORTED error: what "not supported" means and how to fix it — this error's family across 3 libraries.

Related errors


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