Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Sqoop Extract from HDFS - Primary Key Yes or No

avatar
New Contributor

Hi

 

I want to export data out of HDFS using Sqoop into a new Teradata table

 

The Teradata table is yet to be built so we can define it to be the same as the extract we will provide.

 

My question is when exporting using Sqoop does the table I'm exporting to need to have a primary key defined on it or can I export to a table without one

 

Thanks

 

 

 

1 ACCEPTED SOLUTION

avatar
Champion

Sqoop export will transfer data to Database using Insert statement as soon the user fires the export command ,Sqoop will connect to database to fetch the metada about the table. The only prequist that pertains to sqoop export command is that (--table parameter) table  must exist prior to runining sqoop. You can have the table with primary key or not is up to your design . The user have to make sure that there not be any constraint violations while performing the Sqoop export(i,e INSERT)

 

 

View solution in original post

1 REPLY 1

avatar
Champion

Sqoop export will transfer data to Database using Insert statement as soon the user fires the export command ,Sqoop will connect to database to fetch the metada about the table. The only prequist that pertains to sqoop export command is that (--table parameter) table  must exist prior to runining sqoop. You can have the table with primary key or not is up to your design . The user have to make sure that there not be any constraint violations while performing the Sqoop export(i,e INSERT)