A streaming pipeline writes to S3 using time-based partitions. A query must return the latest state of an entity across updates, including handling multiple updates within the same partition window. Which method best supports this requirement in Athena/Redshift Spectrum?

Answer

Use a deterministic record versioning key (e.g., event-time + sequence) and apply window functions to select the latest per entity

Explanation

Latest-state queries require deterministic ordering across updates; window functions with a versioning key select the correct record per entity. This remains correct even when multiple updates occur in the same time partition.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error
QuestionBack to list