cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Error while writing dataframe to csv file.

Shriyash
New Contributor II

Hi Folks, 
Need help to resolve an error. I'm getting a below error while writing a dataframe into a csv file and exporting that file.

Error:
py4j.protocol.Py4JJavaError: An error occurred while calling o53.save.
: java.lang.UnsatisfiedLinkError: 'boolean 

Code Snippet:

mode_write = "overwrite"
header_write = "true"
path = "F://SampleData_Databricks/Certificate_Output/"
certified_df.write \
.option("mode", mode_write) \
.option("header", header) \
.option("path", path) \
.save()

Can someone help me to resolve this issue?

3 REPLIES 3

Witold
Contributor III

@Shriyash wrote:

Hi Folks, 
Need help to resolve an error. I'm getting a below error while writing a dataframe into a csv file and exporting that file.

Error:
py4j.protocol.Py4JJavaError: An error occurred while calling o53.save.
: java.lang.UnsatisfiedLinkError: 'boolean 

Code Snippet:

mode_write = "overwrite"
header_write = "true"
path = "F://SampleData_Databricks/Certificate_Output/"
certified_df.write \
.option("mode", mode_write) \
.option("header", header) \
.option("path", path) \
.save()
path = "F://SampleData_Databricks/Certificate_Output/"

You're working in a cloud environment. You can't write to your local storage from there. Try to write to your corresponding cloud storage instead.

Shriyash
New Contributor II

Hi Witold, When you say cloud environment are you refering to databricks?๐Ÿค”
The Path, where I'm trying to store the data, might be misleading as folder name have Databricks naming in it. But I'm working in my local setup, From Databricks I'm able to write the file in DBFS. 
When It comes to local setup It is causing trouble.

Screenshot for reference.

Shriyash_0-1719857163353.png

Let me know, If I'm missing something.

Thanks,
Shriyash

Witold
Contributor III

Do I see it correctly that you're actually not using Databricks, but Spark, locally installed, instead? Your issue can have many different causes, like an incompatible Java version. In this case, I can only refer to the official docs.

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