stevenzwu commented on PR #18526: URL: https://github.com/apache/iceberg/pull/18526#issuecomment-6202582071
A note on the type choice for the `_last_updated_time` metadata column and the `tracking.snapshot_timestamp` field. Earlier drafts used `long` milliseconds for both (`_last_updated_timestamp_ms` and `timestamp_ms`) to mirror the snapshot's `timestamp-ms`. Following Micah's suggestion, both now use `timestamptz` (microseconds): - **SQL usability**: users can filter with timestamp literals and functions directly, e.g. `WHERE _last_updated_time > now() - INTERVAL 1 HOUR`, instead of working with epoch milliseconds, and values display as readable timestamps. - **`timestamptz` rather than `timestamp`**: a commit time is an instant, not a local date-time. This is also consistent with existing metadata tables, where `snapshots.committed_at` and `history.made_current_at` are `timestamptz`. - **Same type for the tracking field**: `tracking.snapshot_timestamp` uses the same type as the column, so inherited values are assigned to rows without conversion, and the field reads naturally in the `entries` and `files` metadata tables. The storage cost is the same as a `long`. The snapshot's `timestamp-ms` is unchanged (`long` milliseconds). It is converted to microseconds once, when a root manifest entry inherits it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
