[ https://issues.apache.org/jira/browse/SPARK-2104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14045413#comment-14045413 ]
Saisai Shao commented on SPARK-2104: ------------------------------------ Hi Reynold, is that annoying message you mentioned above? {quote} org.apache.spark.SparkException: Job aborted due to stage failure: Task not serializable: java.io.NotSerializableException: $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$JavaNonSerializableClass {quote} Seems we can implement writeObject and readObject to use specified serializer like {{ParallelCollectionPartition}}, is that what you want? > RangePartitioner should use user specified serializer to serialize range > bounds > ------------------------------------------------------------------------------- > > Key: SPARK-2104 > URL: https://issues.apache.org/jira/browse/SPARK-2104 > Project: Spark > Issue Type: Bug > Reporter: Reynold Xin > > Otherwise it is pretty annoying to do a sort on types that are not java > serializable. > To reproduce, just set the serializer to Kryo, and run the following job: > {code} > class JavaNonSerializableClass extends Comparable { override def compareTo(o: > JavaNonSerializableClass) = 0 } > sc.parallelize(Seq(new JavaNonSerializableClass, new > JavaNonSerializableClass), 2).map(x => (x,x)).sortByKey() > {code} > Basically the partitioner will always be serialized using Java (by the task > closure serializer). However, the rangeBounds variable in RangePartitioner > should be serialized with the user specified serializer. -- This message was sent by Atlassian JIRA (v6.2#6252)