cancel
Showing results for 
Search instead for 
Did you mean: 
Warehousing & Analytics
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create a table that's visible only to a specific run of a notebook?

fijoy
Contributor

I'd like to create an SQL table in a notebook that's visible to a specific run (session?) of a notebook. Meaning, even if 2 different users run that notebook at the same time, there should be no conflict. And the table should go away once the notebook exits.

How do I do that?

Is a "create temporary view" statement the way to go?

Given views need to be recomputed every time they're accessed, does Databricks have a notion of a "temporary table" that's specific to a run of a notebook?

Thanks.

2 REPLIES 2

Anonymous
Not applicable

Hi @Fijoy Vadakkumpadan​ 

Great to meet you, and thanks for your question!

Let's see if your peers in the community have an answer to your question. Thanks.

igorstar
New Contributor II

For now ‘CREATE TEMPORARY VIEW’ is the way to go. Once you read from it once, the following reads are going to be cached so it won’t be recomputed every time.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.