Removes a Delta table feature (e.g., deletion vectors, change data feed, type widening) and optionally truncates history to allow protocol downgrade.
DROP FEATURE <feature_name> FROM TABLE <table> [TRUNCATE HISTORY]
## Overview Removes a Delta table feature from the table's protocol. Dropping a feature reverses the protocol upgrade that was applied when the feature was enabled. This is the only way to downgrade a table's protocol version, allowing older Delta clients that do not support the feature to read and write the table. ## Behavior - The feature is removed from the table's writer features (and reader features if applicable) in the Delta protocol metadata. - If the feature is currently in use (e.g., deletion vectors exist in active files), the feature's artifacts must be cleaned up before the drop can succeed. For deletion vectors, this means running REORG TABLE to rewrite files without DVs. For change data feed, this means the CDF columns in active files must be removed. - TRUNCATE HISTORY removes old Delta log entries that reference the dropped feature. Without TRUNCATE HISTORY, the feature name remains in historical log entries, which prevents a full protocol downgrade. - A new table version is committed after the feature is successfully dropped. ## Protocol Downgrade Dropping a feature reduces the set of required reader/writer features. If no remaining features require a high protocol version, the effective version drops accordingly. For example, dropping deletionVectors from a table that only had that one advanced feature can bring the writer version back to a lower level. ## Compatibility DROP FEATURE is a DeltaForge extension that implements the Delta protocol's feature removal specification. The resulting table state is compatible with any Delta client that supports the remaining features.
| Name | Type | Description |
|---|---|---|
table | Fully qualified table name or registered table name. The TABLE keyword before the name is optional. | |
feature_name | Feature name (e.g., deletionVectors, changeDataFeed). | |
truncate_history | Truncate history after dropping. |
-- Drop deletion vectors from a table
DROP FEATURE deletionVectors FROM TABLE warehouse.sales.orders;
-- Drop deletion vectors and truncate history
DROP FEATURE deletionVectors FROM warehouse.sales.orders TRUNCATE HISTORY;
-- Drop change data feed
DROP FEATURE changeDataFeed FROM TABLE warehouse.sales.customers;
-- Drop type widening preview feature
DROP FEATURE typeWidening-preview FROM warehouse.sales.products TRUNCATE HISTORY;