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
7 months, 2 weeks agoAhlo
9 months agonewusername
1 year agocd6a625
4 months, 2 weeks agozozoshanky
1 year, 3 months agocookiemonster42
1 year, 3 months ago65bd33e
6 months, 3 weeks ago