Support ALTER TABLE ALTER COLUMN SET/DROP NOT NULL for Iceberg and the native (Prestissimo) worker
Author: Joe-AbrahamCreated Jul 15, 2026Updated Sep 14, 2026
Labelsfeature requesticeberg
Summary
ALTER TABLE ... ALTER COLUMN ... SET NOT NULL / DROP NOT NULL is only partially supported across connectors and execution engines. This issue tracks closing the remaining gaps so the feature behaves consistently everywhere.
Current state
- Hive connector (Java engine):
SET NOT NULL/DROP NOT NULLsupported; enforced onINSERTbyTableWriterOperator. - Hive connector (native/Prestissimo worker): DDL succeeds, but a NOT NULL constraint added via
ALTER COLUMN SET NOT NULLis not enforced on writes — insertingNULLinto such a column succeeds instead of failing withNULL value not allowed for NOT NULL column: <col>. - Iceberg connector (Java engine):
SET NOT NULLsupported (metadata-only Iceberg schema evolution viarequireColumn).DROP NOT NULLis not implemented —ALTER TABLE ... ALTER COLUMN ... DROP NOT NULLfails withThis connector does not support dropping table constraints. - Iceberg connector (native/Prestissimo worker): not exercised today; no native test coverage exists for either
SET NOT NULLorDROP NOT NULL.
Desired behavior
ALTER TABLE ... ALTER COLUMN ... DROP NOT NULLis implemented for the Iceberg connector (IcebergAbstractMetadata), mirroring the existingaddConstraint/SET NOT NULLimplementation viaUpdateSchema.makeColumnOptional(...).- The native (Prestissimo/Velox) worker enforces
NOT NULLconstraints added viaALTER COLUMN SET NOT NULLon writes, for both Hive and Iceberg tables, consistent with the Java engine'sTableWriterOperatorbehavior. - Native test coverage (dual-runner: native worker vs. Java engine) exists for
SET NOT NULL/DROP NOT NULLfor both the Hive and Iceberg connectors, covering: DDL success,SHOW CREATE TABLE/information_schema.columnsreflecting the constraint, INSERT enforcement, and idempotent drop-when-already-nullable.
Additional context
While investigating, found and root-caused two contributing native-side bugs:
PrestoToVeloxQueryPlan.cpp:TableWriteNodewas constructed withnotNullColumnNamesandsourcein the wrong argument order relative to the VeloxTableWriteNodeconstructor signature, silently dropping the not-null column list.presto_cpp/main/common/Exception.cpp:VeloxToPrestoExceptionTranslator::translateunconditionally prefixed the error message withfailingExpression() + " ", producing a stray leading space in messages raised viaVELOX_USER_FAIL(which carries no failing expression), e.g." NULL value not allowed for NOT NULL column: c2"instead of"NULL value not allowed for NOT NULL column: c2".
Source: prestodb/presto