[ 
https://issues.apache.org/jira/browse/SPARK-2331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14376495#comment-14376495
 ] 

Patrick Wendell commented on SPARK-2331:
----------------------------------------

By the way - [~rxin] recently pointed out to me that EmptyRDD is private[spark].

https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/rdd/EmptyRDD.scala#L27

Given that I'm sort of confused how people were using it before. I'm not 
totally sure how making a class private[spark] affects its use in a return type.

> SparkContext.emptyRDD should return RDD[T] not EmptyRDD[T]
> ----------------------------------------------------------
>
>                 Key: SPARK-2331
>                 URL: https://issues.apache.org/jira/browse/SPARK-2331
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core
>    Affects Versions: 1.0.0
>            Reporter: Ian Hummel
>            Priority: Minor
>
> The return type for SparkContext.emptyRDD is EmptyRDD[T].
> It should be RDD[T].  That means you have to add extra type annotations on 
> code like the below (which creates a union of RDDs over some subset of paths 
> in a folder)
> {code}
> val rdds = Seq("a", "b", "c").foldLeft[RDD[String]](sc.emptyRDD[String]) { 
> (rdd, path) ⇒
>           rdd.union(sc.textFile(path))
>         }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to