SET / UNSET / SHOW PROPERTIES

SET PROPERTIES sets persistent properties on data objects (tables, schemas, workspaces). Properties are written to metadata and take effect permanently until explicitly removed.

SET PROPERTIES

Syntax

ALTER TABLE [schema_name.]table_name SET PROPERTIES ('key1'='value1' [, 'key2'='value2' ...]); ALTER SCHEMA schema_name SET PROPERTIES ('key1'='value1' [, ...]); ALTER WORKSPACE workspace_name SET PROPERTIES ('key1'='value1' [, ...]);

Examples

-- Set compression and auto-refresh properties on a table ALTER TABLE sales_records SET PROPERTIES ('compression'='zstd', 'auto_refresh'='true'); -- Set data retention period on a schema ALTER SCHEMA reporting SET PROPERTIES ('data_retention_days'='90'); -- Set a property on a workspace ALTER WORKSPACE analytics_ws SET PROPERTIES ('aa'='bb');

UNSET PROPERTIES

Removes properties that have been set on a data object, restoring the system default configuration.

Syntax

ALTER TABLE [schema_name.]table_name UNSET PROPERTIES (key1 [, key2 ...]); ALTER SCHEMA schema_name UNSET PROPERTIES (key1 [, ...]); ALTER WORKSPACE workspace_name UNSET PROPERTIES (key1 [, ...]);

Examples

-- Remove a single property from a table ALTER TABLE sales_records UNSET PROPERTIES ('compression'); -- Remove multiple properties at once ALTER TABLE customer_feedback UNSET PROPERTIES ('auto_refresh', 'compression'); -- Remove a schema property ALTER SCHEMA reporting UNSET PROPERTIES ('data_retention_days');

SHOW PROPERTIES

View all properties currently set on a data object.

Syntax

SHOW PROPERTIES IN TABLE [schema_name.]table_name; SHOW PROPERTIES IN SCHEMA schema_name; SHOW PROPERTIES IN WORKSPACE workspace_name;

Examples

SHOW PROPERTIES IN TABLE sales_data; SHOW PROPERTIES IN SCHEMA reporting; SHOW PROPERTIES IN WORKSPACE data_science;

Return Format

+------------------+----------------+ | property_key | property_value | +------------------+----------------+ | compression | zstd | | auto_refresh | true | +------------------+----------------+


Supported Table Properties

PropertyDescriptionValid Values
data_lifecycleData lifecycle in days; -1 means disabledPositive integer or -1
data_retention_daysTime Travel retention period; affects UNDROP, TABLE STREAM, and RESTORE0–90
cz.storage.write.max.string.bytesMaximum write length for STRING type; default 16 MBPositive integer (bytes)
cz.storage.write.max.binary.bytesMaximum write length for BINARY type; default 16 MBPositive integer (bytes)
cz.storage.write.max.json.bytesMaximum write length for JSON type; default 16 MBPositive integer (bytes)

Example: increase the maximum STRING length to 32 MB

ALTER TABLE my_table SET PROPERTIES ("cz.storage.write.max.string.bytes"="33554432");


Notes

  • Requires ALTER permission on the corresponding object.
  • Workspace-level property changes typically take effect within about 1 minute.
  • You can set or remove multiple properties in a single command.