Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = ["abababab", "ccffccff", "123123", "56575656"]
- b = ["ab", "55", "adfadf", "123", "5656"]
- output = [True, False, True, True]
- val a = sc.parallelize(List("abababab", "ccffccff", "123123", "56575656"))
- val b = sc.parallelize(List("ab", "55", "adfadf", "123", "5656"))
- a.cartesian(b)
- .map({case (x,y) => (x, x contains y) })
- .reduceByKey(_ || _).map(w => w._1 + "," + w._2).saveAsTextFile("./output.txt")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement