RiyazAliM
Honored Contributor

Hi @theron 

If you have enabled LC while table creation, you must have already specified the cluster column. Thus I don't see a reason to mention  .clusterBy(key) again.

Let me know if any questions

Cheers!

If you want to create a brand new table with LC enabled or enable LC while writing to that table use the .clusterBy(key) method.

OPTIMIZE FULL should only be ran if you change the cluster keys or enabling clustering for the first time on a delta table. If you run OPTIMIZE FULL regularly, it's same as running OPTIMIZE.

Usually, predictive optimization automatically runs OPTIMIZE commands for all LC enabled tables. To trigger it manually, you can run the OPTIMIZE command explicitly.

Riz