
Answer-first summary for fast verification
Answer: Identify the version number corresponding to two weeks ago from the Delta transaction log, share that version number with the analyst to query using VERSION AS OF syntax, or export that version to a new Delta table for the analyst to query.
The correct approach is **B** because Delta Lake's Time Travel feature allows querying historical data using the `VERSION AS OF` syntax without altering the current table. Identifying the version number from the transaction log and sharing it enables the analyst to directly query the snapshot. Alternatively, exporting the version to a new table provides a static copy. Option **C** (using `RESTORE`) is incorrect because it reverts the entire table to the prior version, disrupting the current state for all users. Option **A** (truncating and reloading) is destructive and inefficient. Option **D** (`VACUUM`) would remove older versions, making Time Travel impossible.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
In a healthcare organization using Delta Lake to store electronic health records (EHRs), a data analyst needs to examine a historical snapshot of the patient_records table from two weeks ago before recent data corrections were applied.
What method should the Data Engineer implement to enable the analyst to query that specific earlier version of the data?
A
Truncate the table to remove all data, then reload the data from two weeks ago into the truncated table for the analyst to query.
B
Identify the version number corresponding to two weeks ago from the Delta transaction log, share that version number with the analyst to query using VERSION AS OF syntax, or export that version to a new Delta table for the analyst to query.
C
Restore the table to the version from two weeks ago using the RESTORE command, and have the analyst query the restored table.
D
Use the VACUUM command to remove all versions of the table older than two weeks, then the analyst can query the remaining version.
No comments yet.