Skip to content
Closed
Next Next commit
add default RDD name for one create via sc.textFile
The feature was first added at commit: 7b877b2 but was later removed (probably by mistake) at at commit: fc8b581.

here is the symptom:

using spark-1.5.2-bin-hadoop2.6 I get:
=================================
scala> sc.textFile("/home/root/.bashrc").name
res5: String = null

scala> sc.binaryFiles("/home/root/.bashrc").name
res6: String = /home/root/.bashrc

while using Spark 1.3.1:
=================================

scala> sc.textFile("/home/root/.bashrc").name
res0: String = /home/root/.bashrc

scala> sc.binaryFiles("/home/root/.bashrc").name
res1: String = /home/root/.bashrc
  • Loading branch information
yaron committed Dec 23, 2015
commit 86efdade980f63cce9f87696716c5d0c74eef245
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
minPartitions: Int = defaultMinPartitions): RDD[String] = withScope {
assertNotStopped()
hadoopFile(path, classOf[TextInputFormat], classOf[LongWritable], classOf[Text],
minPartitions).map(pair => pair._2.toString)
minPartitions).map(pair => pair._2.toString).setName(path)
}

/**
Expand Down