Associate-Developer-Apache-Spark Exam Question 41

Which of the following code blocks returns a DataFrame with a single column in which all items in column attributes of DataFrame itemsDf are listed that contain the letter i?
Sample of DataFrame itemsDf:
1.+------+----------------------------------+-----------------------------+-------------------+
2.|itemId|itemName |attributes |supplier |
3.+------+----------------------------------+-----------------------------+-------------------+
4.|1 |Thick Coat for Walking in the Snow|[blue, winter, cozy] |Sports Company Inc.|
5.|2 |Elegant Outdoors Summer Dress |[red, summer, fresh, cooling]|YetiX |
6.|3 |Outdoors Backpack |[green, summer, travel] |Sports Company Inc.|
7.+------+----------------------------------+-----------------------------+-------------------+
  • Associate-Developer-Apache-Spark Exam Question 42

    Which of the following code blocks adds a column predErrorSqrt to DataFrame transactionsDf that is the square root of column predError?
  • Associate-Developer-Apache-Spark Exam Question 43

    The code block displayed below contains an error. The code block should arrange the rows of DataFrame transactionsDf using information from two columns in an ordered fashion, arranging first by column value, showing smaller numbers at the top and greater numbers at the bottom, and then by column predError, for which all values should be arranged in the inverse way of the order of items in column value. Find the error.
    Code block:
    transactionsDf.orderBy('value', asc_nulls_first(col('predError')))
  • Associate-Developer-Apache-Spark Exam Question 44

    Which of the following code blocks creates a new 6-column DataFrame by appending the rows of the
    6-column DataFrame yesterdayTransactionsDf to the rows of the 6-column DataFrame todayTransactionsDf, ignoring that both DataFrames have different column names?
  • Associate-Developer-Apache-Spark Exam Question 45

    The code block shown below should return a two-column DataFrame with columns transactionId and supplier, with combined information from DataFrames itemsDf and transactionsDf. The code block should merge rows in which column productId of DataFrame transactionsDf matches the value of column itemId in DataFrame itemsDf, but only where column storeId of DataFrame transactionsDf does not match column itemId of DataFrame itemsDf. Choose the answer that correctly fills the blanks in the code block to accomplish this.
    Code block:
    transactionsDf.__1__(itemsDf, __2__).__3__(__4__)