An Athena staging table contains multiple versions of each customer record. Cleaning must retain one complete row per customer: the latest update timestamp, with ties resolved by the highest unique ingestion sequence. Which approach meets these requirements?
Show the answer
Correct answerB. Number each customer's rows by descending timestamp and sequence using ROW_NUMBER, then retain row 1.
AWhy not this: RANK based only on timestamp can assign rank 1 to multiple records and ignores the required tie-breaker.
BWhy this is right: Partitioning by customer and ordering by both fields selects one complete row using the required tie-breaker.
CWhy not this: DISTINCT removes identical rows but leaves different versions of the same customer.
DWhy not this: Independent maxima can combine values from different records into a row that never existed.
ROW_NUMBER partitioned by customer and ordered by descending timestamp and ingestion sequence selects exactly one complete, deterministic record. RANK ordered only by timestamp can retain multiple tied records.