Complete the code to read a Delta Lake table using Spark.
df = spark.read.format([1]).load("/delta/events")
Delta Lake tables are read using the format 'delta' in Spark.
Complete the code to write a DataFrame to a Delta Lake table with overwrite mode.
df.write.format("delta").mode([1]).save("/delta/events")
To replace existing data in Delta Lake, use 'overwrite' mode.
Fix the error in the code to enable Delta Lake's ACID transactions by setting the correct option.
spark.conf.set("spark.sql.extensions", [1])
The correct extension to enable Delta Lake features is 'org.apache.spark.sql.delta.DeltaSparkSessionExtension'.
Fill both blanks to create a Delta Lake table with schema evolution and change data feed enabled.
df.write.format("delta").option([1], "true").option([2], "true").save("/delta/events")
Setting 'mergeSchema' to true allows schema evolution. 'enableChangeDataFeed' enables change data feed, leveraging time travel for reliable change tracking.
Fill all three blanks to create a Delta Lake table with partitioning, schema evolution, and data skipping enabled.
df.write.format("delta").partitionBy([1]).option([2], "true").option([3], "true").save("/delta/events")
Partitioning by 'date' improves query speed. 'mergeSchema' allows schema evolution. 'dataSkippingEnabled' enables data skipping for faster reads.
