Allow a retention time zone on native timestamp columns - #760
Merged
mkuchenbecker merged 1 commit intoSep 22, 2026
Conversation
Native timestamp columns hold a wall clock in an arbitrary producer zone, not UTC, so the retention time zone declares that zone, the same way it declares the zone of a string label. The validator no longer rejects a zone on a time-partitioned (native timestamp) table; it rejects a zone only when a string column's pattern already encodes one. The delete SQL needs no change: the app builds now in the declared zone, and the native date_trunc predicate already reads that zoned wall clock, so the cutoff is evaluated in the column's zone. A SparkJobUtil test pins that the native statement interpolates the zoned wall clock, and the validator tests now accept a zone on a native table. Known limitation: with backup enabled, the Iceberg backup filter compares an absolute instant while the native delete compares a wall clock, so for a native column with a non-UTC zone the two can differ by the offset. Backup is a secondary path, so this is left as a follow-up rather than reintroducing a computed cutoff. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #732 (
mkuchenbecker/retention-timezone-support); review that PR first.What this changes
Native timestamp retention columns hold a wall clock in an arbitrary producer zone, not UTC. This lets the retention time zone declare that zone, the same way it already declares the zone of a string label. Before this change, a zone on a time-partitioned (native timestamp) table was rejected.
nowin the declared zone, and the nativedate_truncpredicate already reads that zoned wall clock, so the cutoff is evaluated in the column's zone.Known limitation
With backup enabled, the Iceberg backup filter compares an absolute instant while the native delete compares a wall clock, so for a native column with a non-UTC zone the two can differ by the offset. Backup is a secondary path and metadata-only is not a hard requirement, so this is left as a follow-up rather than reintroducing a computed cutoff.
Tests
SparkJobUtiltest pins that the native statement interpolates the zoned wall clock.