Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-11806 Spark 2.0 deprecations and removals
  3. SPARK-2331

SparkContext.emptyRDD should return RDD[T] not EmptyRDD[T]

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.0.0
    • 2.0.0
    • Spark Core
    • None

    Description

      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)

      val rdds = Seq("a", "b", "c").foldLeft[RDD[String]](sc.emptyRDD[String]) { (rdd, path) ⇒
                rdd.union(sc.textFile(path))
              }
      

      Attachments

        Activity

          People

            rxin Reynold Xin
            themodernlife Ian Hummel
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: