Associate-Developer-Apache-Spark Exam Question 21

Which of the following code blocks produces the following output, given DataFrame transactionsDf?
Output:
1.root
2. |-- transactionId: integer (nullable = true)
3. |-- predError: integer (nullable = true)
4. |-- value: integer (nullable = true)
5. |-- storeId: integer (nullable = true)
6. |-- productId: integer (nullable = true)
7. |-- f: integer (nullable = true)
DataFrame transactionsDf:
1.+-------------+---------+-----+-------+---------+----+
2.|transactionId|predError|value|storeId|productId| f|
3.+-------------+---------+-----+-------+---------+----+
4.| 1| 3| 4| 25| 1|null|
5.| 2| 6| 7| 2| 2|null|
6.| 3| 3| null| 25| 3|null|
7.+-------------+---------+-----+-------+---------+----+
  • Associate-Developer-Apache-Spark Exam Question 22

    Which of the following statements about stages is correct?
  • Associate-Developer-Apache-Spark Exam Question 23

    The code block displayed below contains multiple errors. The code block should return a DataFrame that contains only columns transactionId, predError, value and storeId of DataFrame transactionsDf. Find the errors.
    Code block:
    transactionsDf.select([col(productId), col(f)])
    Sample of transactionsDf:
    1.+-------------+---------+-----+-------+---------+----+
    2.|transactionId|predError|value|storeId|productId| f|
    3.+-------------+---------+-----+-------+---------+----+
    4.| 1| 3| 4| 25| 1|null|
    5.| 2| 6| 7| 2| 2|null|
    6.| 3| 3| null| 25| 3|null|
    7.+-------------+---------+-----+-------+---------+----+
  • Associate-Developer-Apache-Spark Exam Question 24

    Which of the following code blocks returns all unique values of column storeId in DataFrame transactionsDf?
  • Associate-Developer-Apache-Spark Exam Question 25

    Which of the following code blocks shuffles DataFrame transactionsDf, which has 8 partitions, so that it has
    10 partitions?