Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (path.endsWith(".zip")) {
- sc.binaryFiles(path, minPartitions) .flatMap {
- case (name: String, content: PortableDataStream) => val zis = new ZipInputStream(content.open) // this solution works only for single file in the zip
- val entry = zis.getNextEntry
- val br = new BufferedReader(new InputStreamReader(zis))
- Stream.continually(br.readLine()).takeWhile(_ != null) } }
- else {
- sc.textFile(path, minPartitions)
- }
Add Comment
Please, Sign In to add comment