User16763506477
Databricks Employee
Databricks Employee

If there is no data then lines 10 and 11 will not have any impact. I am assuming that line (1-5) is creating an empty table but the actual load is happening when you do df.write operation.

Also delta.autoOptimize.autoCompact will not trigger the z-ordering please refer below doc.

https://docs.databricks.com/delta/optimizations/auto-optimize.html#does-auto-optimize-z-order-files

View solution in original post