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 do I clear all output results in a notebook?

KendraVant
New Contributor II

I'm building notebooks for tutorial sessions and I want to clear all the output results from the notebook before distributing it to the participants.

This functionality exists in Juypter but I can't find it in Databricks. Any pointers?

1 ACCEPTED SOLUTION

Accepted Solutions

holly
New Contributor III
New Contributor III

Yes! Run > โ€ƒClear >  Clear all cell outputs

Screenshot 2024-07-01 at 12.18.42.png

Fun fact, this feature was made ~10 years ago when we realised all our customer demos looked very messy and had lots of spoilers in them!

View solution in original post

7 REPLIES 7

Arun_KumarPT
New Contributor II

Hi Kendrav,

I used to export the notebook after my work. The exported notebooks will not have any output messages. You can distribute the exported notebooks.

Hi Arunkumar. Unfortunately that doesn't seem to work for me. Did you do anything special before you exported? I still find all the results display when I import a notebook from someone else.

Arun_KumarPT
New Contributor II

's3Connection' is a scala notebook.

For export,

0693f000007OrmiAAC

For import,

0693f000007OrmjAAC

Thanks Arumkumar. Hopefully simpler functionality is on it's way.

schnee1
New Contributor III

I recently watched a webinar in which @rxin clear the results from the Javascript Console (in Chrome)

View -> Developer -> JavaScript Console

and then type "notebook.clearResults()"

The webinar was about Spark 2.0, which was great, but that little bit of JavaScript was a gem. Databricks should expose that in the UI somewhere.

Shawn_Eary
New Contributor III

schnee1's solution seems like it might not work since the function appears to be called client side, but I just tried this in MS Edge on Windows 11 and it seemed to fix the problem where I couldn't clone a Notebook that had too much cell output. Very strange. Also, I agree with schnee1 that the "notebook.clearResults()" function call should be made available as a client-side button.

holly
New Contributor III
New Contributor III

Yes! Run > โ€ƒClear >  Clear all cell outputs

Screenshot 2024-07-01 at 12.18.42.png

Fun fact, this feature was made ~10 years ago when we realised all our customer demos looked very messy and had lots of spoilers in them!

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!