cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to solve Py4JJavaError: An error occurred while calling o5082.csv. : org.apache.spark.SparkException: Job aborted. when writing to csv

laus
New Contributor III

Screenshot 2022-03-31 at 17.33.26Hi ,

I get the error: Py4JJavaError: An error occurred while calling o5082.csv.

: org.apache.spark.SparkException: Job aborted. when writing to csv.

Screenshot below with detail error.

Any idea how to solve it?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Noopur_Nigam
Valued Contributor II

Please try output.coalesce(1).write.option("header","true").format("csv").save("path")

It seems to be same to https://community.databricks.com/s/topic/0TO3f000000CjVqGAK/py4jjavaerror

View solution in original post

4 REPLIES 4

Kaniz_Fatma
Community Manager
Community Manager

Hi @Laura Blancarteโ€‹, Looks like you want to save your dataframe as csv. Did you try to download the preview?

rahrthr12
New Contributor II

i am also facing same issue

User16764241763
Honored Contributor

Hello @Laura Blancarteโ€‹ , @Rahul Rathoreโ€‹ 

Would you mind sharing sample data from the input dataframe that is producing this error while saving?

Noopur_Nigam
Valued Contributor II

Please try output.coalesce(1).write.option("header","true").format("csv").save("path")

It seems to be same to https://community.databricks.com/s/topic/0TO3f000000CjVqGAK/py4jjavaerror

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group