Complete the code to specify the Parquet file format when saving a DataFrame in Spark.
df.write.format("[1]").save("/data/output")
To save data in Parquet format, use format("parquet").
Complete the code to read an Avro file into a Spark DataFrame.
spark.read.format("[1]").load("/data/input.avro")
To read Avro files, use format("avro") with Spark.
Fix the error in the code to write a DataFrame in ORC format.
df.write.[1]("/data/output.orc")
saveAsTextFile for ORC files causes wrong output.saveAsOrcFile causes errors.Use df.write.orc(path) to write ORC files in Spark.
Fill both blanks to create a DataFrame from a Parquet file and select only the 'name' column.
df = spark.read.[1]("/data/users.parquet").select("[2]")
Use parquet to read Parquet files and select the 'name' column.
Fill all three blanks to write a DataFrame in Avro format with overwrite mode and save to '/data/avro_output'.
df.write.mode("[1]").format("[2]").save("[3]")
Use mode("overwrite") to overwrite, format("avro") for Avro, and the correct path to save.
