Spark Lake Table Maintenance
DescriptionSpark Lake Table Maintenance runs operational SQL / procedures against a Delta Lake or Apache Iceberg table on the native Spark pipeline engine: compaction (OPTIMIZE / rewrite data files), vacuum, expire snapshots, rewrite manifests, or conditional deletes. It is a zero-input action sink (no hop required). Destructive operations require an explicit acknowledgement. Connectors ship with the native Spark plugin. Session rules: Lakehouse tables on the native Spark engine. |
Options
| Option | Description |
|---|---|
Transform name | Unique name of the transform in the pipeline. |
Format |
|
Identifier mode |
|
Table path / Table identifier / Spark Catalog | Same semantics as other Lake Table transforms. |
Operation | See Operations matrix below. |
Retention hours | Required for |
Retain last | Iceberg |
Where clause | Optional filter for |
Z-Order columns | Optional comma-separated columns for Delta |
Acknowledge destructive | Must be enabled for |
Operations matrix
| Operation | Delta | Iceberg |
|---|---|---|
OPTIMIZE |
|
|
VACUUM |
| Not used — use |
EXPIRE_SNAPSHOTS | n/a |
|
REWRITE_MANIFESTS | n/a |
|
DELETE_WHERE |
| Same SQL pattern; destructive ack |
Aliases accepted for operation: COMPACT / REWRITE_DATA_FILES → OPTIMIZE; EXPIRE → EXPIRE_SNAPSHOTS; DELETE → DELETE_WHERE.
Behaviour
-
SQL is executed as a Spark action during graph materialisation; an empty leaf Dataset is registered afterward.
-
Iceberg CALL procedures use the catalog name from TABLE mode (
lakeinlake.db.t) orhop_icebergfor PATH mode. -
Metrics are log-only; expect little or no GUI row traffic on this sink.
Metadata injection
Supports metadata injection.
Keys: FORMAT, IDENTIFIER_MODE, TABLE_PATH, TABLE_IDENTIFIER, CATALOG_METADATA_NAME, OPERATION, RETENTION_HOURS, RETAIN_LAST, WHERE_CLAUSE, ZORDER_COLUMNS, ACKNOWLEDGE_DESTRUCTIVE.
Injecting pipelines can drive fleet-wide OPTIMIZE/VACUUM across many tables; still set retention and destructive acknowledgement deliberately.