Efficiently upserting CSV data without creating duplicates has some data to tease out.
Also this Video shows how the parsed data will be created. But the method he is using to upload the data to Firestore might not be applicable to you if you are using SQL because doing the bulk update to SQL is far easier. This is a documentation version of that video: Insert CSV data into a database | Retool Docs.
This is an example of uploading direct from CSV, but without transforming first: Bulk Insert query in postgres not inserting data SOLVED
Hopefully those help.