Reputation: 11445
I am working with spark and scala. I have the below code that works fine on spark-shell, but when I try to move it over to Intelij it throws on error, stating unable to find split
.
What am I missing, what do I need to import for split
to work
var outputDF = inputDF.withColumn(srcColumn,
split(inputDF.col(srcColumn),splitBy).getItem(selectIndex))
Upvotes: 3
Views: 1891
Reputation: 37832
You're probably missing this import:
import org.apache.spark.sql.functions._
(which is provided automatically in a Spark shell)
Upvotes: 8