Complete the code to read a Parquet file into a Spark DataFrame.
df = spark.read.[1]("/data/sample.parquet")
To read a Parquet file, use spark.read.parquet().
Complete the code to write a DataFrame as a Delta Lake table.
df.write.format("[1]").mode("overwrite").save("/data/delta_table")
Delta Lake tables are saved using the delta format.
Fix the error in the code to read a Delta Lake table.
df = spark.read.[1]("/data/delta_table")
Reading a Delta Lake table requires the delta format.
Fill both blanks to create a Delta Lake table and enable schema evolution.
df.write.format("[1]") .mode("append") .option("[2]", "true") .save("/data/delta_table")
Use delta format and mergeSchema option to allow schema evolution when appending.
Fill all three blanks to create a dictionary comprehension that filters Parquet files by size and converts file names to uppercase.
file_info = {file[1]: file_size [2] 1000 for file, file_size in files.items() if file_size [3] 500}The comprehension converts file names to uppercase using .upper(), sets the value to file_size > 1000 (boolean), and filters to include only files where file_size < 500.
