
Answer-first summary for fast verification
Answer: Use the DESCRIBE HISTORY command to find the version, then use the SELECT * FROM historical_data VERSION AS OF command to query the specific version.
To query a specific version of a Delta Lake table, you first need to identify the version using the DESCRIBE HISTORY command. Once you have the version number, you can use the SELECT * FROM historical_data VERSION AS OF command to query that specific version. Querying a specific version is important for auditing, debugging, and ensuring data consistency across different points in time.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
Consider a scenario where you need to query a specific version of a Delta Lake table named 'historical_data' from six months ago. Describe the SQL command you would use to achieve this and explain why querying a specific version is important.
A
Use the SELECT * FROM historical_data command to query the latest version of the table.
B
Use the DESCRIBE HISTORY command to find the version, then use the SELECT * FROM historical_data VERSION AS OF command to query the specific version.
C
Use the RESTORE TABLE command to revert to the desired version and then query the table.
D
Use the VACUUM command to clean up the table and then query the desired version.