Skip to content

Commit

Permalink
Revert this but for now put things in list pandas
Browse files Browse the repository at this point in the history
  • Loading branch information
holdenk committed Apr 8, 2014
1 parent b4e0b1d commit c4510e2
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,9 @@ class PairRDDFunctions[K: ClassTag, V: ClassTag](self: RDD[(K, V)])
*/
def join[W](other: RDD[(K, W)], partitioner: Partitioner): RDD[(K, (V, W))] = {
this.cogroup(other, partitioner).flatMapValues { case (vs, ws) =>
val vlist = vs.toList
val wlist = ws.toList
for (v <- vs; w <- wlist.iterator) yield (v, w)
for (v <- vlist; w <- wlist) yield (v, w)
}
}

Expand All @@ -314,8 +315,9 @@ class PairRDDFunctions[K: ClassTag, V: ClassTag](self: RDD[(K, V)])
if (ws.isEmpty) {
vs.map(v => (v, None))
} else {
val vlist = vs.toList
val wlist = ws.toList
for (v <- vs; w <- wlist.iterator) yield (v, Some(w))
for (v <- vlist; w <- wlist) yield (v, Some(w))
}
}
}
Expand All @@ -332,8 +334,9 @@ class PairRDDFunctions[K: ClassTag, V: ClassTag](self: RDD[(K, V)])
if (vs.isEmpty) {
ws.map(w => (None, w))
} else {
val vlist = vs.toList
val wlist = ws.toList
for (v <- vs; w <- wlist) yield (Some(v), w)
for (v <- vlist; w <- wlist) yield (Some(v), w)
}
}
}
Expand Down

0 comments on commit c4510e2

Please sign in to comment.