Question 31

Which of the following describes a narrow transformation?
  • Question 32

    The code block displayed below contains an error. The code block is intended to join DataFrame itemsDf with the larger DataFrame transactionsDf on column itemId. Find the error.
    Code block:
    transactionsDf.join(itemsDf, "itemId", how="broadcast")
  • Question 33

    The code block displayed below contains an error. The code block should read the csv file located at path data/transactions.csv into DataFrame transactionsDf, using the first row as column header and casting the columns in the most appropriate type. Find the error.
    First 3 rows of transactions.csv:
    1.transactionId;storeId;productId;name
    2.1;23;12;green grass
    3.2;35;31;yellow sun
    4.3;23;12;green grass
    Code block:
    transactionsDf = spark.read.load("data/transactions.csv", sep=";", format="csv", header=True)
  • Question 34

    Which of the following code blocks returns all unique values across all values in columns value and productId in DataFrame transactionsDf in a one-column DataFrame?
  • Question 35

    Which of the following code blocks returns a DataFrame with an added column to DataFrame transactionsDf that shows the unix epoch timestamps in column transactionDate as strings in the format month/day/year in column transactionDateFormatted?
    Excerpt of DataFrame transactionsDf: