dr_cleanup()
Considers only framework-named tables belonging to completed successful, blocked or
errored runs. Published release tables, running jobs, landing files, quality
evidence and report manifests are always retained. Active runs are never eligible. All historical release tables are protected.
Usage
dr_cleanup(lake, older_than_days = 30, dry_run = TRUE, at = Sys.time())Arguments
- lake
- Connected lake.
- older_than_days
- Positive retention period for unpublished run tables.
- dry_run
- Return a plan without removing tables. Defaults to
TRUE. - at
- POSIXct scalar used to evaluate retention.
Value
A tibble with schema, table, run, age and action. Executed drops are
enclosed in one catalog transaction and eligibility is checked again.
Details
Dropping a DuckLake table does not immediately reclaim physical object-store
files. This function does not expire DuckLake snapshots or run file cleanup.
Examples
\dontshow{if (requireNamespace("duckdb", quietly = TRUE)) withAutoprint(\{ # examplesIf}
root <- tempfile("dataraft-")
lake <- dataraft.lake::dr_connect_lake(dr_lake_config(dr_registry_duckdb(file.path(root, "lake.db")),
dr_storage_local(file.path(root, "data")),
landing = file.path(root, "landing"), backend = "duckdb"))
dr_cleanup(lake)
dataraft.lake::dr_disconnect_lake(lake)
unlink(root, recursive = TRUE)
\dontshow{\}) # examplesIf}Documentation source snapshot · View source at 113c179 ↗
Code examples are documented source examples; they are not executed in this website build.
Code examples are documented source examples; they are not executed in this website build.