I'm writing a dataframe to csv with the following code:
df.write\
.option("header",True) \
.mode("overwrite") \
.option("sep","|")\
.format("csv") \
.save("filepath")
I need to limit the size of the output file to 1gb.
For example, if the size of the data is 5gb, the output should be 5 files of 1 gb each.
How to achieve this?