Skip to content

ALTER TABLE

Changes the schema or properties of a table.

SET TBLPROPERTIES

Add or update key-value properties on a table:

ALTER TABLE users SET TBLPROPERTIES ('team' = 'data-eng', 'env' = 'production');

If a property already exists, its value is overwritten:

ALTER TABLE users SET TBLPROPERTIES ('env' = 'staging');

UNSET TBLPROPERTIES

Remove properties from a table:

ALTER TABLE users UNSET TBLPROPERTIES ('env');

Remove multiple properties at once:

ALTER TABLE users UNSET TBLPROPERTIES ('team', 'env');

Unsetting a property that does not exist is a no-op (no error is raised).

Limitations

The enable_stable_row_ids property controls stable row ID tracking in the Lance format and can only be set at table creation time via TBLPROPERTIES in CREATE TABLE. Changing it via ALTER TABLE updates the stored config value but does not change the actual row ID tracking behavior.

-- Correct: set at creation time
CREATE TABLE users (id BIGINT, name STRING)
    TBLPROPERTIES ('enable_stable_row_ids' = 'true');

-- Has no behavioral effect after creation
ALTER TABLE users SET TBLPROPERTIES ('enable_stable_row_ids' = 'true');