score:5

Accepted answer

assuming combined has the type rdd[(string, string)], and levenshtein.distance has this signature:

def distance(s1:string, s2:string)

you can apply it as follows:

val newrdd = combined.map { case (s1, s2) => levenshtein.distance(s1, s2) }

or, alternatively:

val newrdd = combined.map(t => levenshtein.distance(t._1, t._2))

Related Query

More Query from same tag