Is it possible to use Liquid Clustering on Delta Live Tables / Materialised Views?

DataGeek_JT
New Contributor II

Is it possible to use Liquid Clustering on Delta Live Tables? 

If it is available what is the Python syntax for adding liquid clustering to a Delta Live Table / Materialised view please? 

amr
Databricks Employee
Databricks Employee

Delta Live Tables are not actully tables, it is a pipeline tool that manage delta tables. you can enable liquid clustering on the delta tables that are used by DLT. am not sure about MV, but I think it should work since MVs are materialised as detla table too. but maybe you can try it and let us know the result.

kerem
Contributor

Hi @amr, materialised views are not tables, they are views. Liquid clustering is not supported on views so it will throw [EXPECT_TABLE_NOT_VIEW.NO_ALTERNATIVE] error. 

Unfortunately it will be the same case for the "optimize" command as well. 

surajitDE
Contributor

what is the Python syntax for adding liquid clustering to a Delta Live Table???

Surajit Metya

surajitDE
Contributor

@Dlt.table(
name=table_name,
comment="just_testing",
table_properties={
"quality": "gold",
"mergeSchema": "true"
},
cluster_by=["test_id", "find_date"] # Optimizes for queries filtering on these columns
)
def testing_table():
return create_testing_table(df_final, test_type)

Surajit Metya