cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a temporary file with sql

nlee
New Contributor

what are the commands to create a temporary file with SQL

1 ACCEPTED SOLUTION

Accepted Solutions

mathan_pillai
Valued Contributor
Valued Contributor

In Spark SQL, you could use commands like "insert overwrite directory" that indirectly creates a temporary file with the data

https://docs.databricks.com/spark/latest/spark-sql/language-manual/sql-ref-syntax-dml-insert-overwri...

Using shell you could create directory using

%sh mkdir /tmp/file

& create temp file using

echo 'This is a test' > data.txt

If you have more questions, please let us know what is the use case are you trying to do

View solution in original post

1 REPLY 1

mathan_pillai
Valued Contributor
Valued Contributor

In Spark SQL, you could use commands like "insert overwrite directory" that indirectly creates a temporary file with the data

https://docs.databricks.com/spark/latest/spark-sql/language-manual/sql-ref-syntax-dml-insert-overwri...

Using shell you could create directory using

%sh mkdir /tmp/file

& create temp file using

echo 'This is a test' > data.txt

If you have more questions, please let us know what is the use case are you trying to do

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.