Skip to content

Vacuum Command

Vacuum command allows for garbage collection of a delta table.

Vacuum command can be executed as a SQL command or DeltaTable operator.

Demo

VACUUM SQL Command

val q = sql("VACUUM delta.`/tmp/delta/t1`")
scala> q.show
Deleted 0 files and directories in a total of 2 directories.
+------------------+
|              path|
+------------------+
|file:/tmp/delta/t1|
+------------------+

DeltaTable.vacuum

import io.delta.tables.DeltaTable
DeltaTable.forPath("/tmp/delta/t1").vacuum

Dry Run

Visit Demo: Vacuum.


Last update: 2021-04-17