Spark Notebooks Quiz

5 questions Pass: 70% +25 pts (50 with Pro)

Quiz covering Transform Data

What you'll be asked

  1. Which command is used in a Spark notebook to display the first few rows of a DataFrame?
  2. When performing a transformation in Spark, such as .filter() or .select(), why does the operation not execute immediately?
  3. You have a DataFrame 'df' and want to remove duplicate rows based on the 'id' column. Which code snippet is correct?
  4. Which function would you use to change the data type of an existing column in a Spark DataFrame?
  5. You are joining two large DataFrames, 'df1' and 'df2', on a common key. To avoid a full shuffle and optimize performance, you suspect one DataFrame is small enough to fit in memory. Which join type should you use?

Answers and explanations come after you submit.