โ08-28-2023 12:17 AM
Hi Team,
I have a requirement where I need to create temporary table not temporary view.
Can you tell me how to create temporary table in data bricks ?
โ08-02-2024 12:22 PM
โ02-05-2024 11:13 AM
Can you share why you want a table instead of a view? I use createOrReplaceGlobalTempView if I need my temp view in other notebooks.
โ08-01-2025 09:53 AM
When there is a complex logic which takes long time to process using TEMP views for further processing will take processing time of the calling script + the time of the TEMP view which is not optimal in DBMS. SAme effect or slower than writing the temp view code as a sub query....
If it is a TEMP TABLE then the data can be reused as much as required and will be auto discarded at end of session.
โ04-30-2024 09:14 PM
Hi mano7438,
CREATE TEMPORARY TABLE my_table
USING <CSV>
OPTIONS (
path 'dbfs:/<path-to-your-file>/file.tsv',
delimiter '\t',
header 'true'
)
or
CREATE TEMPORARY TABLE temp_table (id int) using parquet;
Note: CREATE TEMPORARY TABLE without a provider is not allowed.
Thanks!
โ08-01-2025 10:04 AM
Thank you for the syntax.
How do I insert data into this created temp table. When I use SQL syntax it gives me an error message..
โ04-30-2024 10:12 PM
I just learnt, the above is a LEGACY support and hence must not be used. This isn't supported syntax, so there would be a lot of restrictions on the usage of this.
Internally it is just a view and hence we should go for create temp view instead.
I know your question was sometime back(so for newer visits to this query), I would like to understand, are you wanting to migrate and it blocks you somehow?
โ08-02-2024 12:22 PM
โ08-02-2024 05:03 PM
I see, thanks for sharing, can you mark the solution which worked for you @abueno as Accepted.
Passionate about hosting events and connecting people? Help us grow a vibrant local communityโsign up today to get started!
Sign Up Now