The orca binary doesn't link iceberg, so expiry runs in a binary of the
project's own that does: bin/orca_maintain.mojo,
from orca.maintain import maintain_main
def main() raises:
maintain_main()
which orca expire and the scheduler's periodic expiry run (it is found as
$ORCA_MAINTAIN, beside the orca binary, or on PATH). Run by hand it
takes the snapshots to keep besides the policy's with --retain; orca expire works those out from Postgres (orca.expiry.retained) and passes
them, which is how a run that can still resume keeps the snapshots it read
and the ones it committed.
orca_maintain expire <dataset> [--older-than 30d|12h|90m|<ms>]
[--keep N] [--retain ID,...] [--if-policy] [--dry-run] [--report]
Without --older-than and --keep the table's own
history.expire.max-snapshot-age-ms and history.expire.min-snapshots-to-keep
decide (iceberg's defaults where unset: five days, one snapshot);
--if-policy expires nothing when the table has no
history.expire.max-snapshot-age-ms, which is how the scheduler leaves
tables orca didn't create alone. An expiry gives a table orca's metadata
defaults (write.metadata.delete-after-commit.enabled,
write.metadata.previous-versions-max) when it lacks them, so its own
commit already deletes the old metadata files it drops from the log. --report lists metadata/ before and
after, to count its files.