Exit DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK Databricks Certified Associate Developer for Apache Spark 3.0
Question 4 of 5
0% complete
Q4 Single choice

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.+------+----------------------------------+-----------------------------+-------------------+

  • A

    itemsDf.select(explode("attributes").alias("attributes_exploded")).filter(attributes_exploded.c ontains
    ("i"))

  • B

    itemsDf.explode(attributes).alias("attributes_exploded").filter(col("attributes_exploded").con tains("i"))

  • C

    itemsDf.select(explode("attributes")).filter("attributes_exploded".contains("i"))

  • D

    itemsDf.select(explode("attributes").alias("attributes_exploded")).filter(col("attributes_explo
    ded").contains("i"))

  • E

    itemsDf.select(col("attributes").explode().alias("attributes_exploded")).filter(col("attributes_e
    xploded").contains("i"))