GitHub user yongtang opened a pull request:

    https://github.com/apache/spark/pull/5708

    [SPARK-7155] [CORE] Allow newAPIHadoopFile to support comma-separated list 
of files as input

    See JIRA: https://issues.apache.org/jira/browse/SPARK-7155
    
    SparkContext's newAPIHadoopFile() does not support comma-separated list of 
files. For example, the following:
    ```scala
    sc.newAPIHadoopFile("/root/file1.txt,/root/file2.txt", 
classOf[TextInputFormat], classOf[LongWritable], classOf[Text])
    ```
    will throw
    ```
    org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path 
does not exist: file:/root/file1.txt,/root/file2.txt
    ```
    However, the other API hadoopFile() is able to process comma-separated list 
of files correctly. In addition, since sc.textFile() uses hadoopFile(), it is 
also able to process comma-separated list of files correctly.
    
    That means the behaviors of hadoopFile() and newAPIHadoopFile() are not 
aligned.
    
    This pull request fix this issue and allows newAPIHadoopFile() to support 
comma-separated list of files as input.
    
    A unit test has also been added in SparkContextSuite.scala. It creates two 
temporary text files as the input and tested against sc.textFile(), 
sc.hadoopFile(), and sc.newAPIHadoopFile().
    
    Note: The contribution is my original work and that I license the work to 
the project under the project's open source license.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/yongtang/spark SPARK-7155

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/5708.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #5708
    
----
commit 73e1f16b4ab57f708d2cac1442574479bda9b4f1
Author: yongtang <[email protected]>
Date:   2015-04-26T18:44:01Z

    [SPARK-7155] [CORE] Allow newAPIHadoopFile to support comma-separated list 
of files as input.

----


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to