Variant support in Delta Lake
Preview
This feature is in Public Preview.
You can use the VARIANT
data type to store semi-structured data in Delta Lake. For examples on working with VARIANT
, see Query variant data.
You must use Databricks Runtime 15.3 or above to read and write tables with variant support enabled.
Enable variant on a Delta table
To enable variant, create a new table with a VARIANT
type column, for example:
CREATE TABLE table_name (variant_column VARIANT)
You can also enable support for VARIANT
on an existing table using the following syntax:
ALTER TABLE table_name SET TBLPROPERTIES('delta.feature.variantType-preview' = 'supported')
Warning
When you enable variant, the table protocol is upgraded. After upgrading, the table will not be readable by Delta Lake clients that do not support variant. See How does Databricks manage Delta Lake feature compatibility?.