Github user mateiz commented on a diff in the pull request:

    https://github.com/apache/spark/pull/252#discussion_r11233008
  
    --- Diff: 
core/src/main/scala/org/apache/spark/api/java/JavaSparkContext.scala ---
    @@ -154,6 +154,31 @@ class JavaSparkContext(val sc: SparkContext) extends 
JavaSparkContextVarargsWork
        */
       def textFile(path: String, minSplits: Int): JavaRDD[String] = 
sc.textFile(path, minSplits)
     
    +  /**
    +   * Read a directory of text files from HDFS, a local file system 
(available on all nodes), or any
    +   * Hadoop-supported file system URI. Each file is read as a single 
record and returned in a
    +   * key-value pair, where the key is the path of each file, the value is 
the content of each file.
    +   *
    +   * <p> For example, if you have the following files:
    +   * {{{
    +   *   hdfs://a-hdfs-path/part-00000
    +   *   hdfs://a-hdfs-path/part-00001
    +   *   ...
    +   *   hdfs://a-hdfs-path/part-nnnnn
    +   * }}}
    +   *
    +   * Do `val rdd = mlContext.wholeTextFile("hdfs://a-hdfs-path")`,
    +   *
    +   * <p> then `rdd` contains
    +   * {{{
    +   *   (a-hdfs-path/part-00000, its content)
    +   *   (a-hdfs-path/part-00001, its content)
    +   *   ...
    +   *   (a-hdfs-path/part-nnnnn, its content)
    +   * }}}
    +   */
    +  def wholeTextFiles(path: String): JavaRDD[(String, String)] = 
sc.wholeTextFiles(path)
    --- End diff --
    
    This should return a JavaPairRDD, see how those are created in the rest of 
the API.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to