Set Delta Lake table properties
Applies to: SaaS connectors
Database connectors
Query-based connectors
You can set Delta Lake table properties on the destination streaming tables that a managed ingestion pipeline creates. Because destination tables are streaming tables managed by the pipeline, you set table properties through the pipeline's ingestion_definition rather than by running ALTER TABLE ... SET TBLPROPERTIES directly. Specifying table_properties in the pipeline spec has the same effect as the ALTER TABLE ... SET TBLPROPERTIES command.
You can set table properties at two levels:
Level | Behavior |
|---|---|
Pipeline | Set |
Table or schema | Set |
Before you enable a table property, verify the reader and writer version requirements for that feature. For property-specific requirements, see Table properties reference and the documentation for the feature you're enabling, such as Type widening.
Set table properties using the API
You can set table properties when you create or edit managed ingestion pipelines using Declarative Automation Bundles, notebooks, or the Databricks CLI.
The following example enables type widening at the pipeline level, and then overrides it to false for the users_1 destination table. The calendar_test table inherits the pipeline-level setting.
- Declarative Automation Bundles
- Databricks notebook
- Databricks CLI
resources:
pipelines:
pipeline_cdc:
name: <pipeline-name>
catalog: <destination-catalog>
schema: <destination-schema>
ingestion_definition:
ingestion_gateway_id: <gateway-pipeline-id>
table_configuration:
table_properties:
delta.enableTypeWidening: 'true'
delta.enableDeletionVectors: 'true'
objects:
- table:
source_schema: <source-schema>
source_table: users_1
destination_catalog: <destination-catalog>
destination_schema: <destination-schema>
table_configuration:
table_properties:
delta.enableTypeWidening: 'false'
- table:
source_schema: <source-schema>
source_table: calendar_test
destination_catalog: <destination-catalog>
destination_schema: <destination-schema>
pipeline_spec = """
{
"ingestion_definition": {
"ingestion_gateway_id": "<gateway-pipeline-id>",
"table_configuration": {
"table_properties": {
"delta.enableTypeWidening": "true",
"delta.enableDeletionVectors": "true"
}
},
"objects": [
{
"table": {
"source_schema": "<source-schema>",
"source_table": "users_1",
"destination_catalog": "<destination-catalog>",
"destination_schema": "<destination-schema>",
"table_configuration": {
"table_properties": {
"delta.enableTypeWidening": "false"
}
}
}
},
{
"table": {
"source_schema": "<source-schema>",
"source_table": "calendar_test",
"destination_catalog": "<destination-catalog>",
"destination_schema": "<destination-schema>"
}
}
]
}
}
"""
{
"ingestion_definition": {
"ingestion_gateway_id": "<gateway-pipeline-id>",
"table_configuration": {
"table_properties": {
"delta.enableTypeWidening": "true",
"delta.enableDeletionVectors": "true"
}
},
"objects": [
{
"table": {
"source_schema": "<source-schema>",
"source_table": "users_1",
"destination_catalog": "<destination-catalog>",
"destination_schema": "<destination-schema>",
"table_configuration": {
"table_properties": {
"delta.enableTypeWidening": "false"
}
}
}
},
{
"table": {
"source_schema": "<source-schema>",
"source_table": "calendar_test",
"destination_catalog": "<destination-catalog>",
"destination_schema": "<destination-schema>"
}
}
]
}
}
You can specify multiple table properties in a single table_properties block.
Support special characters in column names
If a source column name contains characters that Delta Lake doesn't allow by default, such as spaces, commas, or parentheses, the pipeline fails with the DELTA_INVALID_CHARACTERS_IN_COLUMN_NAMES error. This commonly happens when you ingest files whose headers are maintained by business users, such as Excel or CSV files from SharePoint. For the full list of characters, see Supported characters in column names.
To ingest these columns without renaming them, turn on Delta Lake column mapping for the destination table by setting delta.columnMapping.mode to name in the table_properties of that table's table_configuration. Add the property to the pipeline spec of each affected table.
The following example turns on column mapping for a destination table in a SharePoint file ingestion pipeline:
- Declarative Automation Bundles
- Databricks notebook
resources:
pipelines:
sharepoint_csv_pipeline:
name: sharepoint_csv_pipeline
catalog: <destination-catalog>
schema: <destination-schema>
channel: PREVIEW
ingestion_definition:
connection_name: <sharepoint-connection>
objects:
- table:
destination_catalog: <destination-catalog>
destination_schema: <destination-schema>
destination_table: <destination-table>
table_configuration:
table_properties:
delta.columnMapping.mode: 'name'
connector_options:
sharepoint_options:
entity_type: FILE
url: https://<tenant>.sharepoint.com/sites/<site>/<folder>
file_ingestion_options:
format: CSV
schema_evolution_mode: NONE
pipeline_spec = """
{
"name": "<pipeline-name>",
"catalog": "<destination-catalog>",
"schema": "<destination-schema>",
"channel": "PREVIEW",
"ingestion_definition": {
"connection_name": "<sharepoint-connection>",
"objects": [
{
"table": {
"destination_catalog": "<destination-catalog>",
"destination_schema": "<destination-schema>",
"destination_table": "<destination-table>",
"table_configuration": {
"table_properties": {
"delta.columnMapping.mode": "name"
}
},
"connector_options": {
"sharepoint_options": {
"entity_type": "FILE",
"url": "https://<tenant>.sharepoint.com/sites/<site>/<folder>",
"file_ingestion_options": {
"format": "CSV",
"schema_evolution_mode": "NONE"
}
}
}
}
}
]
}
}
"""
Keep the following in mind when you turn on column mapping for a managed ingestion pipeline:
- Set the property in the table's
table_properties. Settingspark.databricks.delta.properties.defaults.columnMapping.modein the pipeline configuration, or creating the destination table in advance with column mapping turned on, doesn't resolve the error. The pipeline owns the destination streaming table, so you also can't runALTER TABLE ... SET TBLPROPERTIESon it. - After you add
table_propertiesto the spec, the pipeline might show a warning. The pipeline still runs.
Column mapping upgrades the table protocol to reader version 2 and writer version 5, and it might break legacy partition-directory workloads, change data feed, and streaming reads from the table. For details, see Limitations.
Inheritance and overrides
Table properties follow an inheritance model, where settings applied to an individual table or schema take precedence over pipeline-level defaults.
- Table properties set at the pipeline level are inherited by all tables and schemas in the pipeline.
- A
table_configurationset at the table or schema level overrides the pipeline-level configuration. When you override at the table or schema level, other pipeline-level table configurations are not inherited. To keep a pipeline-level configuration, repeat it in the override.
Limitations
The following limitation applies when setting table properties on managed ingestion pipelines.
Removing a table property from the pipeline spec does not automatically revert the underlying table feature. For example, if you enable delta.enableTypeWidening and later find that your reader Databricks Runtime version doesn't support type widening, removing the property from the spec doesn't undo the change. In that case, you must perform a full refresh of the affected tables. Before you change a table property, confirm whether reverting the property resolves the issue or whether a full refresh is required. See Fully refresh target tables.