Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Ostrzak
New Contributor III

Overwriting a csv using Spark notebook creates artifacts

Hi everyone,

 

It might be a bit stupid of a question, but is there a way to overwrite csv files in a lakehouse (using Pyspark notebook) without creation of additional folders/artifacts?

 

Right now when I use:

df.write.mode("overwrite").csv("file_path")
 
A new subfolder is created (named as original file), within it SUCCESS artifact and a .csv file with a hashed name. 

Ostrzak_0-1698687647912.png

I can live with it, but it would be nice if it could just overwrite a file and leave it in the same destination. 

Thank you in advance for any feedback.

1 ACCEPTED SOLUTION
AndyDDC
Valued Contributor

Hi @Ostrzak what is the value in "file_path"?  If I specify a Files folder to save the CSV to, it replaces the current CSV with a new version - changing the CSV filename in the process.  But the old one has been removed.

 

AndyDDC_0-1698694337789.png

 

 

AndyDDC_1-1698694354260.png

 

View solution in original post

4 REPLIES 4
AndyDDC
Valued Contributor

Hi @Ostrzak what is the value in "file_path"?  If I specify a Files folder to save the CSV to, it replaces the current CSV with a new version - changing the CSV filename in the process.  But the old one has been removed.

 

AndyDDC_0-1698694337789.png

 

 

AndyDDC_1-1698694354260.png

 

Ostrzak
New Contributor III

Hi @AndyDDC 

 

Thank you for answering.

I had it saved directly to the lakehouse Files, without any subfolder. When I overwrite it, it lands in a subfolder that is named as the file before, while inside there are  two entities:

- csv file with hashed name

- SUCCESS artifact

I see from your example that it works fine after it creates the aforementioned structure. That is useful knowledge. I guess I have to get accustomed to this structure, at the end of a day it is still human-readable.

AndyDDC
Valued Contributor

Yes it's advisable to have sub-folders when writing, as there could be overwrite issues.

If my reply has been helpful please consider marking it as the solution.

Glad it's sorted now

Anonymous
Not applicable

Hi @Ostrzak ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. Otherwise, will respond back with the more details and we will try to help .

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Free Fabric Certifications

Free Fabric Certifications

Get Fabric certified for free! Don't miss your chance.

January Fabric Update Carousel

Fabric Monthly Update - January 2026

Check out the January 2026 Fabric update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (728)