Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.3.1
-
None
-
Ubuntu 14.04
Description
SparkContext's newAPIHadoopFile() does not support comma-separated list of files. For example, the following:
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.
The problem is that newAPIHadoopFile() use addInputPath() to add the file path into NewHadoopRDD. See Ln 928-931, master branch:
val job = new NewHadoopJob(conf)
NewFileInputFormat.addInputPath(job, new Path(path))
val updatedConf = job.getConfiguration
new NewHadoopRDD(this, fClass, kClass, vClass, updatedConf).setName(path)
Change addInputPath(job, new Path(path)) to addInputPaths(job, path) will resolve this issue.
Attachments
Issue Links
- is duplicated by
-
SPARK-5544 wholeTextFiles should recognize multiple input paths delimited by ,
- Resolved
- links to