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.