When applying broadcast variable with collectasmap(), not all the values are included by broadcast variable. e.g.
val emp = sc.textFile("...text1.txt").map(line => (line.split("\t")(3),line.split("\t")(1))).distinct()
val emp_new = sc.textFile("...text2.txt").map(line => (line.split("\t")(3),line.split("\t")(1))).distinct()
emp_new.foreach(println)
val emp_newBC = sc.broadcast(emp_new.collectAsMap())
println(emp_newBC.value)
When i checked the values within emp_newBC I saw that not all the data from emp_new appear. What am i missing?
Thanks in advance.