
Answer-first summary for fast verification
Answer: SELECT * FROM students@v4, SELECT * FROM students TIMESTAMP AS OF ‘2024-04-22T 14:32:47.000+00:00’
To query the 'students' table as it existed before the UPDATE operation, the Data Engineer should use either the version or timestamp from the state immediately prior to the UPDATE. The UPDATE operation is listed at version 5 with a timestamp of '2024-04-22T14:32:58.000'. The state before this is version 4 with a timestamp of '2024-04-22T14:32:47.000'. Therefore, the correct commands are: - **Option A**: `SELECT * FROM students@v4` correctly references version 4 using the `@v` syntax for time travel. - **Option B**: `SELECT * FROM students TIMESTAMP AS OF '2024-04-22T14:32:47.000+00:00'` correctly uses the timestamp of version 4 to query the table before the UPDATE. Options D and E reference version 5 or its timestamp, which include the UPDATE and are incorrect. Option C uses invalid syntax and is incorrect.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
The Delta transaction log for the 'students' table is displayed using the DESCRIBE HISTORY students command. A Data Engineer needs to query the table as it existed prior to the UPDATE operation shown in the log.
Which commands should the Data Engineer use to accomplish this? (Select two correct options.)
version | timestamp | operation
--------|-------------------------|-----------
8 | 2024-04-22T14:33:31.000 | OPTIMIZE
7 | 2024-04-22T14:33:16.000 | MERGE
6 | 2024-04-22T14:33:06.000 | DELETE
5 | 2024-04-22T14:32:58.000 | UPDATE
4 | 2024-04-22T14:32:47.000 | WRITE
3 | 2024-04-22T14:32:44.000 | WRITE
2 | 2024-04-22T14:32:23.000 | WRITE
1 | 2024-04-22T14:32:20.000 | WRITE
0 | 2024-04-22T14:31:49.000 | CREATE TABLE
version | timestamp | operation
--------|-------------------------|-----------
8 | 2024-04-22T14:33:31.000 | OPTIMIZE
7 | 2024-04-22T14:33:16.000 | MERGE
6 | 2024-04-22T14:33:06.000 | DELETE
5 | 2024-04-22T14:32:58.000 | UPDATE
4 | 2024-04-22T14:32:47.000 | WRITE
3 | 2024-04-22T14:32:44.000 | WRITE
2 | 2024-04-22T14:32:23.000 | WRITE
1 | 2024-04-22T14:32:20.000 | WRITE
0 | 2024-04-22T14:31:49.000 | CREATE TABLE
A
SELECT * FROM students@v4
B
SELECT * FROM students TIMESTAMP AS OF ‘2024-04-22T 14:32:47.000+00:00’
C
SELECT * FROM students FROM HISTORY VERSION AS OF 3
D
SELECT * FROM students VERSION AS OF 5
E
SELECT * FROM students TIMESTAMP AS OF ‘2024-04-22T 14:32:58.000+00:00’