- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ03-31-2022 09:35 AM
Hi,
I'm trying to save a dataframe to csv with the code below:
output.coalesce(1).write.mode('overwrite').option('header', 'true').csv(tmp_file_path)
But it get "Py4JJavaError: An error occurred while calling o5082.csv." error.
Any idea how to solve it?
Thanks in advance!
- Labels:
-
Error
-
Py4jjavaerror
-
Tmp File Path
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ04-25-2022 03:17 PM
Hi @Laura Blancarteโ ,
What format is your "output" dataframe? Have you try to run something like this? output.coalesce(1).write.option("header","true").format("csv").save("path_to_location")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ04-25-2022 03:17 PM
Hi @Laura Blancarteโ ,
What format is your "output" dataframe? Have you try to run something like this? output.coalesce(1).write.option("header","true").format("csv").save("path_to_location")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ05-10-2022 10:27 AM
Hi @Laura Blancarteโ ,
Just a friendly follow-up. Do you still need help or you were able to find a solution to your question? if my previous response helped you to resolve your questions, please mark it as best.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ05-10-2022 11:24 AM
Only just seen this but your had used your solution in other scripts and it works!

