- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2026 01:47 PM
You’re hitting the new 7-day time-travel enforcement: in recent runtimes, time travel is blocked beyond delta.deletedFileRetentionDuration (default 7 days), regardless of VACUUM args or logRetentionDuration.
To support 30 days of historical data for reporting, you have two options:
1. Use Delta retention settings for 30-day time travel
If 30 days is enough history and you’re okay paying for the extra storage, just configure the table’s Delta properties:
ALTER TABLE catalog.schema.table_name
SET TBLPROPERTIES (
'delta.deletedFileRetentionDuration' = 'interval 30 days',
'delta.logRetentionDuration' = 'interval 30 days'
);
delta.deletedFileRetentionDurationcontrols how long old data files are kept and therefore the maximum time-travel window (default 7 days).delta.logRetentionDurationcontrols how long the transaction log/history is kept (default 30 days) and must be ≥deletedFileRetentionDurationin new runtimes.- Docs explicitly note: to access 30 days of history, set
delta.deletedFileRetentionDuration = "interval 30 days"to match the defaultlogRetentionDuration.
This is the simplest way to have a 30-day rolling history directly available via time travel for your trend reports.
2. (Recommended for robust reporting) Build a dedicated history / trend table
Delta docs and guidance caution against relying on table history as a long-term backup or analytics store and recommend using history/time travel mainly for short-term ops and recovery.
For reporting use cases (especially if you may want >30 days later), a common pattern is:
- Create a separate “history” or “snapshot” Delta table, partitioned by a logical date (e.g.,
snapshot_dateor business date). - On a daily job (or whatever cadence you need):
- Either:
- Take a point-in-time snapshot of the source table and append it with that day’s
snapshot_date, or - Use Change Data Feed (CDF) to upsert incremental changes into a slowly-changing dimension / fact table with effective dates.
- Take a point-in-time snapshot of the source table and append it with that day’s
- Either:
- Point your BI / trend reports at this reporting table, not at time-travel queries.
This pattern keeps reporting predictable and decoupled from operational retention and VACUUM settings, while you still keep ~30 days of native time travel for debugging and recovery.