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: 

Can I generate a uuid4 column when I do a COPY INTO command?

chrisf_sts
New Contributor II

I have raw call log data and the logs don't have a unique id number so I generate a uuid4 number when i load them using spark.  Now I want to save the records to a table, and run a COPY INTO command every day to ingest new records.  I am only appending new records, never updating, and I want to generate the uuid column on the COPY INTO command the same way I do when i read the files into the dataframe.  Is this possible?

1 REPLY 1

Kaniz_Fatma
Community Manager
Community Manager

Hi @chrisf_stsYou can achieve this by generating UUIDs during the COPY INTO command.

Here are a few approaches based on the database system you’re using:

  1. PostgreSQL:

  2. Snowflake:

  3. LibreOffice Calc (for manual generation):

Remember to adapt these approaches based on your specific database system and requirements. Happy data ingesting! 🚀

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