The code block shown below contains an error. The code block is intended to return a new DataFrame where column managerName from DataFrame storesDF is split at the space character into column managerFirstName and column managerLastName. Identify the error.
A sample of DataFrame storesDF is displayed below:
Code block:
storesDF.withColumn("managerFirstName", col("managerName").split(" ").getItem(0))
.withColumn("managerLastName", col("managerName").split(" ").getItem(1))
Sowwy1
1 month, 1 week agoAhlo
2 months, 3 weeks agonewusername
6 months, 1 week agozozoshanky
9 months, 3 weeks agocookiemonster42
9 months, 3 weeks ago65bd33e
1 week, 5 days ago