
Ultimate access to all questions.
Which of the following commands can be used to write data into a Delta table while avoiding the writing of duplicate records?
A
DROP
B
IGNORE
C
MERGE
D
APPEND
E
INSERT
Explanation:
Correct Answer: C (MERGE)
The MERGE command (also known as UPSERT) is specifically designed to write data into Delta tables while handling duplicates. It allows you to:
This makes MERGE ideal for avoiding duplicate records because you can specify conditions to check for existing records before inserting.
Why other options are incorrect:
Key Concept: In Databricks Delta Lake, MERGE operations are atomic and provide ACID transactions, making them the recommended approach for upsert operations where you need to avoid writing duplicate records while maintaining data integrity.