is there a way to add an argument to a spark UDF in addtion to the column. I know you can use currying in Scala, but it doesn't work as I like it to.
Lets take this function as an example:
def containsWord(word: String, words: Seq[String]): Boolean = {
for (w <- words) if (word.contains(w)) return true
false
}
The word string is the parameter I want to get out of the column. Without the second argument I could create the UDF with the udf function and give it the column as parameter. How can I add the String sequence in the UDF call?
Any help would be appreciated.