I want to convert my Parquet file into CSV . Is there a way for the same as i am only able to find CSV to Parquet file and not vice versa.
This worked for me when using spark 2.1.0. First run spark shell. Something like:
./bin/spark-shell
then:
val sqlContext = new org.apache.spark.sql.SQLContext(sc)
val df = sqlContext.parquetFile("parquet-file.parquet")
df.printSchema()
df.write.format("csv").save("directory")
it will create csv files in directory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With