LFC Delta Lake ACID Transactions 3 — Questions and Answers
Question 1: At what interval does Delta Lake automatically create checkpoint files in the transaction log by default?
- Every 5 commits
- Every 10 commits (Correct answer)
- Every 100 commits
- Every 1,000 commits
Correct answer: Every 10 commits
By default, Delta Lake creates a Parquet checkpoint file every 10 commits to allow faster state reconstruction without replaying the entire JSON log.
Question 2: When Delta Lake detects a write-write conflict during a concurrent transaction commit, what is the expected outcome?
- The transaction is silently retried automatically
- The transaction fails and the application must handle the exception and optionally retry (Correct answer)
- Delta Lake picks the write with the higher timestamp as the winner
- Both writes are merged into a single committed version
Correct answer: The transaction fails and the application must handle the exception and optionally retry
Delta Lake throws a ConcurrentModificationException on write-write conflicts; the application is responsible for catching it and deciding whether to retry.
Question 3: Which Delta Lake operation is guaranteed to be atomic when renaming or replacing an entire table partition?
- Overwriting the Parquet files directly in object storage
- Using Delta Lake's INSERT OVERWRITE or replaceWhere option (Correct answer)
- Running a manual HDFS rename command
- Dropping and recreating the partition with separate SQL statements
Correct answer: Using Delta Lake's INSERT OVERWRITE or replaceWhere option
INSERT OVERWRITE with replaceWhere is atomic in Delta Lake because it records the entire partition replacement as a single transaction log entry.
Question 4: What happens to readers querying a Delta table while a long-running OPTIMIZE operation is running on the same table?
- Readers are blocked for the duration of OPTIMIZE
- Readers see the pre-OPTIMIZE snapshot and are unaffected (Correct answer)
- Readers may see inconsistent file layouts mid-operation
- Readers must use a special READ UNCOMMITTED hint to proceed
Correct answer: Readers see the pre-OPTIMIZE snapshot and are unaffected
OPTIMIZE is a transactional operation; readers see a consistent snapshot from before OPTIMIZE commits and are never blocked or exposed to intermediate state.
Question 5: In Delta Lake, which scenario would cause a transaction to be classified as a 'blind append' and be allowed to succeed even alongside a concurrent write?
- An UPDATE statement targeting a specific partition
- A DELETE statement with a WHERE clause
- An INSERT that only adds new rows without reading existing data (Correct answer)
- A MERGE statement with both MATCHED and NOT MATCHED clauses
Correct answer: An INSERT that only adds new rows without reading existing data
A blind append (INSERT with no dependency on existing table state) never conflicts with concurrent writers because it does not read any existing data to determine what to write.
Question 6: What is the purpose of the 'last_checkpoint' file found in the _delta_log directory?
- It stores the latest committed data snapshot in compressed format
- It is a pointer that tells Delta Lake where to start reading the log for fast state reconstruction (Correct answer)
- It serves as a lock file to prevent concurrent writes
- It contains the schema of the Delta table at its last modification
Correct answer: It is a pointer that tells Delta Lake where to start reading the log for fast state reconstruction
The _last_checkpoint file is a small JSON pointer to the most recent checkpoint file, allowing Delta Lake to skip older log files when reconstructing current table state.
Question 7: Which ACID property ensures that a Delta Lake table never contains partial results from a failed MERGE operation?
- Consistency
- Isolation
- Durability
- Atomicity (Correct answer)
Correct answer: Atomicity
Atomicity guarantees that a MERGE either fully commits (all matched and not-matched actions applied) or fully rolls back, leaving no partial state in the table.
At what interval does Delta Lake automatically create checkpoint files in the transaction log by default?