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:ย 

Exporting R data frame variable

Brave
New Contributor II

Hi all.

I am trying to export R data frame variable as csv file.

I am using this formula:

df<- data.frame(VALIDADOR_FIM)

df.coalesce(1).write.format("com.databricks.spark.csv").option("header", "true").save("dbfs:/FileStore/df/df.csv")

But isnยดt working. How can this as export a csv file?

1 ACCEPTED SOLUTION

Accepted Solutions

sher
Valued Contributor II

Please try to execute write.csv with the following path instead:

write.csv(TotalData,file='/dbfs/tmp/df.csv',row.names = FALSE)

%fs ls /tmp

View solution in original post

5 REPLIES 5

sher
Valued Contributor II

Please try to execute write.csv with the following path instead:

write.csv(TotalData,file='/dbfs/tmp/df.csv',row.names = FALSE)

%fs ls /tmp

Brave
New Contributor II

Hi @sherbin wโ€‹ tanks for Help! Now how i can acess this .csv to download?

I tryed:

%fs ls /tmp

and

read.df(path = "/tmp/VALIDADOR_FIM.csv")

but both didnยดt worked.

sher
Valued Contributor II

@FELIPE VALENTEโ€‹ 

you mean local download ?

Brave
New Contributor II

Yes!

sher
Valued Contributor II

I don't think that will be possible in databricks. may be i wrong.

But what I did was mount s3 put that CSV file there and download it.

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