Isi
Honored Contributor III

Hey!

Well, not many details have been provided, but in general, this approach could work for you. Hope it helps!
df = spark.sql("SELECT * FROM stages.benefit")

df.write.mode("overwrite").option("header", "true").csv(output_path)

🙂