cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Warehousing & Analytics
Engage in discussions on data warehousing, analytics, and BI solutions within the Databricks Community. Share insights, tips, and best practices for leveraging data for informed decision-making.
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.