Skip to content

Commit f18356e

Browse files
author
Brennon York
committed
changed method invocation of 'diff' to match that of 'innerJoin' and 'leftJoin' from VertexRDD[VD] to RDD[(VertexId, VD)]
1 parent 651a1c0 commit f18356e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

graphx/src/main/scala/org/apache/spark/graphx/VertexRDD.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,10 @@ abstract class VertexRDD[VD](
124124
/**
125125
* Hides vertices that are the same between `this` and `other`; for vertices that are different,
126126
* keeps the values from `other`.
127+
*
128+
* @param other the other VertexRDD with which to diff.
127129
*/
128-
def diff(other: VertexRDD[VD]): VertexRDD[VD]
130+
def diff(other: RDD[(VertexId, VD)]): VertexRDD[VD]
129131

130132
/**
131133
* Left joins this RDD with another VertexRDD with the same index. This function will fail if

graphx/src/main/scala/org/apache/spark/graphx/impl/VertexRDDImpl.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ class VertexRDDImpl[VD] private[graphx] (
103103
override def mapValues[VD2: ClassTag](f: (VertexId, VD) => VD2): VertexRDD[VD2] =
104104
this.mapVertexPartitions(_.map(f))
105105

106-
override def diff(other: VertexRDD[VD]): VertexRDD[VD] = {
106+
override def diff(other: RDD[(VertexId, VD)]): VertexRDD[VD] = {
107107
val newPartitionsRDD = partitionsRDD.zipPartitions(
108-
other.partitionsRDD, preservesPartitioning = true
108+
VertexRDD(other).partitionsRDD, preservesPartitioning = true
109109
) { (thisIter, otherIter) =>
110110
val thisPart = thisIter.next()
111111
val otherPart = otherIter.next()

0 commit comments

Comments
 (0)