How to read contents of a CSV file inside zip file using spark (python) I have multiple zip files containing two types of files(A.csv &amp; B.csv)

/data/jan.zip --> contains A.csv &amp; B.csv
/data/feb.zip --> contains A.csv &amp; B.csv

I want to read the contents of all the A.csv files inside all the zip files using pyspark.

 textFile = sc.textFile("hdfs://&lt;HDFS loc&gt;/data/*.zip")


Can someone tell me how to get the contents of A.csv files into an RDD?
You need to ensure the package spark-csv is loaded; e.g., by invoking the spark-shell with the flag --packages com.databricks:spark-csv_2.11:1.4.0. After that you can use sc.textFile as you did, or sqlContext.read.format("csv").load. You might need to use csv.gz instead of just zip; I don't know, I haven't tried.