Complete the code to read a parquet file into a DataFrame.
df = spark.read.[1]("/data/input.parquet")
To read a parquet file, use spark.read.parquet().
Complete the code to write a DataFrame as a parquet file with overwrite mode.
df.write.mode([1]).parquet("/data/output.parquet")
Use mode("overwrite") to replace existing data and ensure idempotency.
Fix the error in the code to drop duplicates from a DataFrame.
df_clean = df.[1]()The correct method to remove duplicate rows is dropDuplicates().
Fill both blanks to create a DataFrame with only unique user IDs and save it idempotently.
unique_users = df.select([1]).[2]() unique_users.write.mode("overwrite").parquet("/data/users_unique.parquet")
Select the user_id column and use distinct() to get unique rows.
Fill all three blanks to build an idempotent pipeline that reads, filters, and writes data.
df = spark.read.[1]("/data/raw.parquet") filtered = df.filter(df[[2]] > 100) filtered.write.mode([3]).parquet("/data/filtered.parquet")
Read parquet data, filter rows where value is greater than 100, and write with overwrite mode for idempotency.
