A data analyst wants to compare the row counts in a Delta table as they existed one week ago against the counts today to detect unexpected data changes. Which approach correctly retrieves historical data for comparison?
Answer & explanation
Correct answer: D
WHY D: Delta Lake time travel supports inline SELECT queries with TIMESTAMP AS OF or VERSION AS OF, so the analyst reads historical data in place without altering the table. Running a historical count and a current count and comparing them is the correct, non-destructive approach.
WHY NOT A: RESTORE does not open a temporary snapshot: it rolls the table itself back to the historical version, replacing the current state. That is destructive and wrong for a read-only comparison.
WHY NOT C: CLONE creates a physical copy, which is unnecessary; time travel SELECT queries work natively inline and do not require a clone.
WHY NOT B: operationMetrics records per-operation metadata such as numOutputRows, not a total table row count at each version that could be used for a historical comparison.
WHY NOT E: VACUUM removes old data files and does not expose historical versions; querying a snapshot at a storage path after VACUUM in this way is not valid.