diff options
author | luluorta <luluorta@gmail.com> | 2014-09-02 19:25:52 -0700 |
---|---|---|
committer | Ankur Dave <ankurdave@gmail.com> | 2014-09-02 19:26:27 -0700 |
commit | 9b225ac3072de522b40b46aba6df1f1c231f13ef (patch) | |
tree | c43b1a6a9176d93410079fd77d833c40c4cd9116 /graphx/src/main | |
parent | e9bb12bea9fbef94332fbec88e3cd9197a27b7ad (diff) | |
download | spark-9b225ac3072de522b40b46aba6df1f1c231f13ef.tar.gz spark-9b225ac3072de522b40b46aba6df1f1c231f13ef.tar.bz2 spark-9b225ac3072de522b40b46aba6df1f1c231f13ef.zip |
[SPARK-2823][GraphX]fix GraphX EdgeRDD zipPartitions
If the users set “spark.default.parallelism” and the value is different with the EdgeRDD partition number, GraphX jobs will throw:
java.lang.IllegalArgumentException: Can't zip RDDs with unequal numbers of partitions
Author: luluorta <luluorta@gmail.com>
Closes #1763 from luluorta/fix-graph-zip and squashes the following commits:
8338961 [luluorta] fix GraphX EdgeRDD zipPartitions
Diffstat (limited to 'graphx/src/main')
-rw-r--r-- | graphx/src/main/scala/org/apache/spark/graphx/EdgeRDD.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/graphx/src/main/scala/org/apache/spark/graphx/EdgeRDD.scala b/graphx/src/main/scala/org/apache/spark/graphx/EdgeRDD.scala index 5bcb96b136..35fbd47e6c 100644 --- a/graphx/src/main/scala/org/apache/spark/graphx/EdgeRDD.scala +++ b/graphx/src/main/scala/org/apache/spark/graphx/EdgeRDD.scala @@ -19,7 +19,7 @@ package org.apache.spark.graphx import scala.reflect.{classTag, ClassTag} -import org.apache.spark.{OneToOneDependency, Partition, Partitioner, TaskContext} +import org.apache.spark._ import org.apache.spark.rdd.RDD import org.apache.spark.storage.StorageLevel @@ -55,7 +55,7 @@ class EdgeRDD[@specialized ED: ClassTag, VD: ClassTag]( * partitioner that allows co-partitioning with `partitionsRDD`. */ override val partitioner = - partitionsRDD.partitioner.orElse(Some(Partitioner.defaultPartitioner(partitionsRDD))) + partitionsRDD.partitioner.orElse(Some(new HashPartitioner(partitionsRDD.partitions.size))) override def compute(part: Partition, context: TaskContext): Iterator[Edge[ED]] = { val p = firstParent[(PartitionID, EdgePartition[ED, VD])].iterator(part, context) |