Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface for per-file-parallelism with Hadoop FS #27

Open
rnowling opened this issue Aug 17, 2015 · 2 comments
Open

Interface for per-file-parallelism with Hadoop FS #27

rnowling opened this issue Aug 17, 2015 · 2 comments

Comments

@rnowling
Copy link
Contributor

For many of the use cases we've seen, parallelism per file versus per line is sufficient performance wise and makes parsing files easier. (e.g. JSON, CSV, etc. file formats which may require keeping track of state from the start of the file is problematic for chunking up files.)

We'd like to provide an API for per-file-parallelism. We'd like to reuse Hadoop's Filesystem interfaces which provides a unified interface to readers for a variety of sources including S3, FTP, HDFS, and POSIX. If using lazy evaluation is possible, we wouldn't have to keep large files in memory. We may also want a way to list and filter on the list of files. (E.g., more than just glob-type expressions.)

@rnowling
Copy link
Contributor Author

Follow up idea courtesy of @willb: implement the API as a custom RDD and provide a sc.partitionPerFileRDD("~/input") method.

@rnowling
Copy link
Contributor Author

The SparkContext provides a wholeTextFile() method which returns pairs of (filename, contents). For large files, this may kill performance so the idea of 1 partition per file may offer better granularity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant