import java.util.zip.ZipInputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
val path = "xxxx.zip"
def loadZip(path:String)={
val minPartitions =10
sc.binaryFiles(path, minPartitions)
.flatMap { case (name: String, content: PortableDataStream)=>
val zis = new ZipInputStream(content.open)
Stream.continually(zis.getNextEntry)
.takeWhile(_ != null)
.flatMap { _ =>
val br = new BufferedReader(new InputStreamReader(zis))
Stream.continually(br.readLine()).takeWhile(_ != null)
}}
}
val rdd = loadZip(path)
|