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! 🚀