Skip to content

Commit

Permalink
Demo: Vacuum
Browse files Browse the repository at this point in the history
  • Loading branch information
jaceklaskowski committed Apr 13, 2023
1 parent 7eaaceb commit 15bbe65
Show file tree
Hide file tree
Showing 2 changed files with 177 additions and 124 deletions.
32 changes: 5 additions & 27 deletions docs/commands/vacuum/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,11 @@

**Vacuum** command allows for [garbage collection of a delta table](VacuumCommand.md#gc).

Vacuum command can be executed as [VACUUM](../../sql/index.md#VACUUM) SQL command or [DeltaTable.vacuum](../../DeltaTable.md#vacuum) operator.
Vacuum command is available using the following high-level operators:

## Demo

### VACUUM SQL Command

```scala
val q = sql("VACUUM delta.`/tmp/delta/t1`")
```

```text
scala> q.show
Deleted 0 files and directories in a total of 2 directories.
+------------------+
| path|
+------------------+
|file:/tmp/delta/t1|
+------------------+
```
* [VACUUM](../../sql/index.md#VACUUM) SQL command
* [DeltaTable.vacuum](../../DeltaTable.md#vacuum)

### DeltaTable.vacuum

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

### Dry Run
## Demo

Visit [Demo: Vacuum](../../demo/vacuum.md).
[Demo: Vacuum](../../demo/vacuum.md)
Loading

0 comments on commit 15bbe65

Please sign in to comment.