cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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
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! 🚀

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.