Which of the following code blocks returns a new DataFrame where column productCategories only has one word per row, resulting in a DataFrame with many more rows than DataFrame storesDF?
A sample of storesDF is displayed below:
A. storesDF.withColumn("productCategories", explode(col("productCategories")))
B. storesDF.withColumn("productCategories", split(col("productCategories")))
C. storesDF.withColumn("productCategories", col("productCategories").explode())
D. storesDF.withColumn("productCategories", col("productCategories").split())
E. storesDF.withColumn("productCategories", explode("productCategories"))
Which of the following code blocks returns a new DataFrame where column productCategories only has one word per row, res
-
- Site Admin
- Posts: 899589
- Joined: Mon Aug 02, 2021 8:13 am