ALTER TABLE¶
Changes the schema or properties of a table.
SET TBLPROPERTIES¶
Add or update key-value properties on a table:
If a property already exists, its value is overwritten:
UNSET TBLPROPERTIES¶
Remove properties from a table:
Remove multiple properties at once:
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');
Rename Table¶
Rename a table within the same namespace:
Rename a table to a different namespace:
Note
Rename is only supported when using a namespace-based catalog (impl=rest).
Directory-based catalogs do not support table renames.
Error Behavior¶
| Scenario | Error |
|---|---|
| Source table does not exist | TABLE_OR_VIEW_NOT_FOUND |
| Target table name already exists | TABLE_ALREADY_EXISTS |
| Directory-based catalog | UnsupportedOperationException |