user2814799
user2814799

Reputation: 559

Sqoop export is successful but destination postgres table is empty

I am trying to export the table from hdfs to postgres Below is the query which I used for export:

sqoop export --connect jdbc:postgresql:hostname:5432/postgresDB --username user --password password --input-fields-terminated-by '\001' --fields-terminated-by ',' --table customer --export-dir /hdfs/location/customer --input-null-string '\\N' --input-null-non-string '\\N' --direct --update-key customer_id 

The sqoop query completes with success message. Please see the screenshot below:

enter image description here

But when I query the table, I am not finding any data.

Any help is appreciated. Thanks in advance.

Upvotes: 0

Views: 880

Answers (2)

Neethu Lalitha
Neethu Lalitha

Reputation: 3071

For me, this worked after I added the schema name for my table name.

-- -- schema my_schema

Upvotes: 0

user2814799
user2814799

Reputation: 559

sqoop export --connect jdbc:postgresql:hostname:5432/postgresDB \
--username user \
--password password \
--input-fields-terminated-by '\001' \
--fields-terminated-by ',' \
--table customer \
--export-dir /hdfs/location/customer \
--input-null-string '\\N' --input-null-non-string '\\N' \
--direct \
--update-mode allowinsert 

This worked ..

Upvotes: 1

Related Questions