{"record":{"id":"0059189fcff706b7","repo":"prestodb/presto","slug":"not-supported-005918","errorCode":"NOT_SUPPORTED","errorMessage":"Catalog '%s' does not support non-null column for column name '%s'","messagePattern":"Catalog '(.+?)' does not support non-null column for column name '(.+?)'","errorType":"error_code","errorClass":"SemanticException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/execution/CreateTableTask.java","lineNumber":142,"sourceCode":"            if (element instanceof ColumnDefinition) {\n                ColumnDefinition column = (ColumnDefinition) element;\n                String columnName = column.getName().getValue();\n                String name = metadata.normalizeIdentifier(session, tableName.getCatalogName(), columnName);\n                Type type;\n                try {\n                    type = metadata.getType(parseTypeSignature(column.getType()));\n                }\n                catch (IllegalArgumentException | UnknownTypeException e) {\n                    throw new SemanticException(TYPE_MISMATCH, element, \"Unknown type '%s' for column '%s'\", column.getType(), column.getName());\n                }\n                if (type.equals(UNKNOWN)) {\n                    throw new SemanticException(TYPE_MISMATCH, element, \"Unknown type '%s' for column '%s'\", column.getType(), column.getName());\n                }\n                if (columns.containsKey(name)) {\n                    throw new SemanticException(DUPLICATE_COLUMN_NAME, column, \"Column name '%s' specified more than once\", column.getName());\n                }\n                if (!column.isNullable() && !metadata.getConnectorCapabilities(session, connectorId).contains(NOT_NULL_COLUMN_CONSTRAINT)) {\n                    throw new SemanticException(NOT_SUPPORTED, column, \"Catalog '%s' does not support non-null column for column name '%s'\", connectorId.getCatalogName(), column.getName());\n                }\n\n                Map<String, Expression> sqlProperties = mapFromProperties(column.getProperties());\n                Map<String, Object> columnProperties = metadata.getColumnPropertyManager().getProperties(\n                        connectorId,\n                        tableName.getCatalogName(),\n                        sqlProperties,\n                        session,\n                        metadata,\n                        parameterLookup);\n\n                columns.put(name, ColumnMetadata.builder()\n                        .setName(name)\n                        .setType(type)\n                        .setNullable(column.isNullable())\n                        .setComment(column.getComment().orElse(null))\n                        .setProperties(columnProperties)\n                        .build());","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/execution/CreateTableTask.java#L124-L160","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Remove the NOT NULL qualifier from the column definition for that catalog.","Use a catalog whose connector supports NOT_NULL_COLUMN_CONSTRAINT (e.g. Iceberg).","Upgrade or patch the connector to implement and declare NOT_NULL_COLUMN_CONSTRAINT.","Enforce non-null semantics downstream (e.g. via a constraint or ETL validation) instead of in the catalog."],"exampleFix":"// before\nCREATE TABLE t (id BIGINT NOT NULL, name VARCHAR);\n// after\nCREATE TABLE t (id BIGINT, name VARCHAR); -- catalog does not support NOT NULL","handlingStrategy":"validation","validationCode":"Set<ConnectorCapability> caps = metadata.getConnectorCapabilities(session, connectorId);\nif (!caps.contains(NOT_NULL_COLUMN_CONSTRAINT)) {\n    // strip NOT NULL from column definitions or pick another catalog before running CREATE TABLE\n}","typeGuard":"boolean supportsNotNull(Session session, CatalogName catalog) {\n    return metadata.getConnectorCapabilities(session, catalog).contains(NOT_NULL_COLUMN_CONSTRAINT);\n}","tryCatchPattern":"try {\n    future = createTableTask.execute(statement, ...);\n} catch (SemanticException e) {\n    if (e.getCode() == NOT_SUPPORTED) {\n        // rewrite DDL without NOT NULL or switch catalog\n    }\n}","preventionTips":["Check connector capabilities (SHOW FUNCTIONS / system.metadata tables or connector docs) before generating NOT NULL DDL.","Keep DDL generation capability-aware per catalog.","Standardize on catalogs (e.g. Iceberg) that support NOT NULL for schemas requiring it."],"tags":["presto","ddl","not-supported","connector-capability","create-table"],"backgroundTag":"connector-capability-not-supported","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"}