Table properties reference
Delta Lake and Apache Iceberg use table properties to control table behavior and features. These properties might have specific meanings and affect behaviors when set.
All operations that set or update table properties conflict with other concurrent write operations, causing them to fail. Databricks recommends you modify a table property only when there are no concurrent write operations on the table.
Modify table properties
To modify table properties of existing tables, use SET TBLPROPERTIES.
Delta and Iceberg formats
Delta Lake and Apache Iceberg tables share the same table property names, but require different prefixes:
- Delta tables: Use the
delta.prefix - Iceberg tables: Use the
iceberg.prefix
For example:
- To enable deletion vectors on a Delta table:
delta.enableDeletionVectors - To enable deletion vectors on an Iceberg table:
iceberg.enableDeletionVectors
Table properties and SparkSession properties
Each table has its own table properties that control its behavior. Some SparkSession configurations always override table properties. For example, autoCompact.enabled and optimizeWrite.enabled enable auto compaction and optimized writes at the SparkSession level. Databricks recommends using table-scoped configurations for most workloads.
You can set default values for new tables using SparkSession configurations. These defaults only apply to new tables and don't affect existing table properties. SparkSession configurations use a different prefix than table properties, as shown in the following table:
Table property | SparkSession configuration |
|---|---|
|
|
For example, to set the appendOnly = true property for all new tables created in a session, set the following:
-- For Delta tables
SET spark.databricks.delta.properties.defaults.appendOnly = true
-- For Iceberg tables
SET spark.databricks.iceberg.properties.defaults.appendOnly = true
Table properties
The following table properties are available for both Delta Lake and Apache Iceberg tables. Use the delta. prefix for Delta tables and iceberg. prefix for Iceberg tables.
Property | Description |
|---|---|
|
See Optimized writes. Data type: Default: (none) |
| The number of columns to collect statistics about for data skipping. A value of See Data skipping. Data type: Default: |
| A comma-separated list of column names on which to collect statistics to enhance data skipping functionality. This property takes precedence over See Data skipping. Data type: Default: (none) |
| The shortest duration to keep logically deleted data files before deleting them physically. This prevents failures in stale readers after compactions or partition overwrites. Set this value large enough to ensure that:
See Configure data retention for time travel queries. Data type: Default: |
|
See Deletion vectors in Databricks and Enable deletion vectors. Data type: Default: Depends on workspace admin settings and Databricks Runtime version. See Auto-enable deletion vectors. |
| How long to keep the history for a table. Databricks automatically cleans up log entries older than the retention interval each time a checkpoint is written. Setting this property to a large value retains many log entries. This doesn't impact performance because operations against the log are constant time. Operations on history are parallel but become more expensive as the log size increases. See Configure data retention for time travel queries. Data type: Default: |
| The minimum required protocol reader version to read from this table. Databricks recommends against manually configuring this property. See Delta Lake feature compatibility and protocols. Data type: Default: |
| The minimum required protocol writer version to write to this table. Databricks recommends against manually configuring this property. See Delta Lake feature compatibility and protocols. Data type: Default: |
| The Iceberg table format version. Databricks recommends against manually configuring this property. See Use Apache Iceberg v3 features. Data type: Default: |
|
Data type: Default: |
| The target file size in bytes or higher units for file tuning. For example, Data type: Default: (none) |
| The compression codec for a table. Valid values: This property ensures that all future writes to the table use the chosen codec, overriding the cluster or session default ( Data type: Default: |
|
Data type: Default: |
| Automatically combines small files within table partitions to reduce small file problems. Accepts See Auto compaction. Data type: Default: (none) |
|
Data type: Default: |
|
Data type: Default: |
|
See Compatibility for tables with liquid clustering. Data type: Default: |
| Enables column mapping for table columns and the corresponding Parquet columns that use different names. See Rename and drop columns with Delta Lake column mapping. Note: Enabling Data type: Default: |
|
Data type: Default: |
|
Data type: Default: |
|
See Type widening. Data type: Default: |
| The degree to which a transaction must be isolated from modifications made by concurrent transactions. Valid values are See Isolation levels and write conflicts on Databricks. Data type: Default: |
| The number of characters to generate for random prefixes when Data type: Default: |
| The shortest duration within which new snapshots retain transaction identifiers (for example, Data type: Default: (none) |
|
Data type: Default: (none) |