
Answer-first summary for fast verification
Answer: Overwrites the data in the table but preserves all historical versions of the data, you can time travel to previous versions
The `INSERT OVERWRITE` command overwrites the current version of the data but preserves all historical versions, allowing you to time travel to previous versions. This means you can still query the prior version of the data using time travel. Any DML/DDL operation (except DROP TABLE) on the Delta table preserves the historical version of the data. For example, to query the previous version of the `customer_sales` table, you can use: `SELECT * FROM customer_sales as of 1`. To see all historical changes on the table, use: `DESCRIBE HISTORY table_name`. Note that the main difference between `INSERT OVERWRITE` and `CREATE OR REPLACE TABLE (CRAS)` is that CRAS can modify the schema of the table, whereas `INSERT OVERWRITE` by default only overwrites the data unless `spark.databricks.delta.schema.autoMerge.enabled` is set to true.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
When using the INSERT OVERWRITE command to reload the customer_sales table, how does it affect the ability to review previous versions of the data?
A
Overwrites the data in the table, all historical versions of the data, you can not time travel to previous versions
B
Overwrites the current version of the data but clears all historical versions of the data, so you can not time travel to previous versions.
C
Appends the data to the current version, you can time travel to previous versions
D
By default, overwrites the data and schema, you cannot perform time travel
E
Overwrites the data in the table but preserves all historical versions of the data, you can time travel to previous versions
No comments yet.