1. Databricks Documentation
"Compact small files into larger ones using OPTIMIZE": "Delta Lake on Databricks can improve the speed of read queries from a table by coalescing small files into larger ones. You can trigger compaction by running the OPTIMIZE command."
Source: Databricks Documentation > Delta Lake > Table utility commands > OPTIMIZE.
2. Databricks Documentation
"What is VACUUM?": "You can remove files that are no longer referenced by a Delta table and are older than the retention threshold by running the VACUUM command on the table." This distinguishes its purpose from OPTIMIZE.
Source: Databricks Documentation > Delta Lake > Table utility commands > VACUUM.
3. Learning Spark
2nd Edition (by Jules S. Damji
et al.): Chapter 9
"Delta Lake
" discusses performance tuning. It explicitly states
"To compact small files
you can use the OPTIMIZE command... This operation is an idempotent operation
meaning that if it’s run twice on the same dataset
the second run has no effect." This confirms OPTIMIZE as the correct command for this task.
Source: O'Reilly
Learning Spark
2nd Edition
Chapter 9
Section: "Compacting Small Files and Z-Ordering".