cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community 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

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
New Contributor II

@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.

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
New Contributor II

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.

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!