Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/rdd/RDD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ abstract class RDD[T: ClassTag](

/** User code that created this RDD (e.g. `textFile`, `parallelize`). */
@transient private[spark] val creationSiteInfo = Utils.getCallSiteInfo
private[spark] def getCreationSite: String = creationSiteInfo.toString
private[spark] def getCreationSite: String = Option(creationSiteInfo).getOrElse("").toString

private[spark] def elementClassTag: ClassTag[T] = classTag[T]

Expand Down
9 changes: 8 additions & 1 deletion core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.scalatest.FunSuite

import org.apache.spark._
import org.apache.spark.SparkContext._
import org.apache.spark.rdd._
import org.apache.spark.util.Utils

class RDDSuite extends FunSuite with SharedSparkContext {

Expand Down Expand Up @@ -66,6 +66,13 @@ class RDDSuite extends FunSuite with SharedSparkContext {
}
}

test("serialization") {
val empty = new EmptyRDD[Int](sc)
val serial = Utils.serialize(empty)
val deserial: EmptyRDD[Int] = Utils.deserialize(serial)
assert(!deserial.toString().isEmpty())
}

test("countApproxDistinct") {

def error(est: Long, size: Long) = math.abs(est - size) / size.toDouble
Expand Down