Delta table properties reference
Delta Lake reserves Delta table properties starting with delta.
. These properties may have specific meanings, and affect behaviors when these properties are set.
Note
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.
How do table properties and SparkSession properties interact?
Delta table properties are set per table. If a property is set on a table, then this is the setting that is followed by default.
Some table properties have associated SparkSession configurations which always take precedence over table properties. Some examples include the spark.databricks.delta.autoCompact.enabled
and spark.databricks.delta.optimizeWrite.enabled
configurations, which turn on auto compaction and optimized writes at the SparkSession level rather than the table level. Databricks recommends using table-scoped configurations for most workloads.
For every Delta table property you can set a default value for new tables using a SparkSession configuration, overriding the built-in default. This setting only affects new tables and does not override or replace properties set on existing tables. The prefix used in the SparkSession is different from the configurations used in the table properties, as shown in the following table:
Delta Lake conf |
SparkSession conf |
---|---|
|
|
For example, to set the delta.appendOnly = true
property for all new Delta Lake tables created in a session, set the following:
SET spark.databricks.delta.properties.defaults.appendOnly = true
To modify table properties of existing tables, use SET TBLPROPERTIES.