Copy from CSV sfile
Hi,
Do I have to create a table before I can use copy statement to import a CSV file to that table?
Can I import CSV file at the same time a new table is created?
Thank you.
0
Hi,
Do I have to create a table before I can use copy statement to import a CSV file to that table?
Can I import CSV file at the same time a new table is created?
Thank you.
Comments
You can grab the headers of the file and create the table before you run copy cmd. (oldschool)
Or
You can use External table build definition on copy cmd:
Note : there is need for access on a location for the user who will run the copy command.
See more details here
https://my.vertica.com/docs/8.0.x/HTML/index.htm#Authoring/SQLReferenceManual/Statements/CREATEEXTERNALTABLEASCOPY.htm
Both are not as fast/ optimium as the default copy cmd on a existing table.