This is a pyspark tutorial in Hindi for beginners to convert spark dataframe to partitioned parquet files as well as to a single parquet file. It covers different ways pyspark write dataframe to a parquet file.
We are also discussing the use of write and format commands. Also coalesce helps us to convert the dataframe into desired number of participants and hence files. So to output all your data in a single file, you can use coalesce and repartition options in pyspark. Considering scope of this pyspark tutorial for data engineers in Hindi, I have implemented coalesce only.
The way we write pyspark dataframe to single parquet file can sometimes become really convenient if reducing the number of files that are present in s3 or directly is your main concern. We can reduce it down by implemented different pyspark write parquet file format options.