Reply
Highlighted
Explorer
Posts: 16
Registered: ‎09-10-2015

Using sqoop import, How to append rows into existing hive table?

From sqlserver I imported and created a hive table using the below query.

 

sqoop import --connect 'jdbc:sqlserver://10.1.1.12;database=testdb' --username uname --password paswd --table demotable --hive-import --hive-table hivedb.demotable --create-hive-table --fields-terminated-by ','

 

Command was successful, imported the data and created a table with 10000 records.

I inserted 10 new records in sqlserver and tried to append these 10 records into existing hive table using --where clause

 

sqoop import --connect 'jdbc:sqlserver://10.1.1.12;database=testdb' --username uname --password paswd --table demotable --where "ID > 10000"

--hive-import -hive-table hivedb.demotable

 

But the sqoop job is getting failed with error

ERROR tool.ImportTool: Error during import: Import job failed!

 

Is any other alternatives to insert into table using sqoop.