Skip to content

Commit aa835d8

Browse files
authored
fix bcast example (#93)
1 parent 3072054 commit aa835d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/scala/com/high-performance-spark-examples/goldilocks/RDDJoinExamples.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ object RDDJoinExamples {
108108
V2 : ClassTag](bigRDD : RDD[(K, V1)],
109109
smallRDD : RDD[(K, V2)])= {
110110
val smallRDDLocal: Map[K, V2] = smallRDD.collectAsMap()
111-
bigRDD.sparkContext.broadcast(smallRDDLocal)
111+
val smallRDDLocalBcast = bigRDD.sparkContext.broadcast(smallRDDLocal)
112112
bigRDD.mapPartitions(iter => {
113113
iter.flatMap{
114114
case (k,v1 ) =>
115-
smallRDDLocal.get(k) match {
115+
smallRDDLocalBcast.value.get(k) match {
116116
case None => Seq.empty[(K, (V1, V2))]
117117
case Some(v2) => Seq((k, (v1, v2)))
118118
}

0 commit comments

Comments
 (0)