Skip to content

Commit 1b5df2c

Browse files
committed
Use the Executor's ClassLoader in sc.objectFile(). This makes it possible to read classes from the object file which were specified in the user-provided jars. (By default ObjectInputStream uses latestUserDefinedLoader, which may or may not be the right one.)
1 parent 6112270 commit 1b5df2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/scala/org/apache/spark/SparkContext.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ class SparkContext(
568568
minSplits: Int = defaultMinSplits
569569
): RDD[T] = {
570570
sequenceFile(path, classOf[NullWritable], classOf[BytesWritable], minSplits)
571-
.flatMap(x => Utils.deserialize[Array[T]](x._2.getBytes))
571+
.flatMap(x => Utils.deserialize[Array[T]](x._2.getBytes, Thread.currentThread.getContextClassLoader))
572572
}
573573

574574

0 commit comments

Comments
 (0)