Page 1 of 1

Which of the following code blocks returns a new DataFrame where column productCategories only has one word per row, res

Posted: Mon Mar 27, 2023 1:39 pm
by answerhappygod
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:
Which Of The Fo 1
Which Of The Fo 1 (7.68 KiB) Viewed 42 times
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"))