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))
tmz1
2 months, 1 week agoSowwy1
12 months agoAhlo
1 year, 1 month agonewusername
1 year, 5 months agocd6a625
9 months agozozoshanky
1 year, 8 months agocookiemonster42
1 year, 8 months ago65bd33e
11 months, 1 week ago