QuestionQ221
VerifiedDeveloping Apache Spark™ DataFrame/DataSet API ApplicationsThe code block below contains an error. It is intended to return a new DataFrame in which the managerName column from DataFrame storesDF is split at the space character into the managerFirstName and managerLastName columns. Identify the error.
A sample of DataFrame storesDF is shown below:

Code block:
storesDF.withColumn("managerFirstName", col("managerName").split(" ").getItem(0))
.withColumn("managerLastName", col("managerName").split(" ").getItem(1))
Community Discussion