cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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
Databricks Employee
Databricks Employee

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
Databricks Employee
Databricks Employee

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

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now