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
Esteemed Contributor III
Esteemed Contributor III

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
Esteemed Contributor III
Esteemed Contributor III

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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group