Sqoop import to hive-table to a directory other than --hive-home

Below is my sqoop import:
sqoop import --connect “jdbc:mysql://nn01.itversity.com:3306/retail_db” --username=retail_dba --password=itversity --table=departments --fields-terminated-by ‘,’ --lines-terminated-by ‘|’ --hive-import --hive-home /user/allus229/hive/warehouse/retail_stage.db/departments --hive-overwrite --hive-table departments --outdir java_files

I already have /user/allus229/hive/warehouse/retail_stage.db/departments created at 07:10 PM. But when I run the above command at lets say at 0730PM, I expect the directory to update. But it is not happening, instead it is create a directory /user/allus229/departments.

What am I missing here?

Hi,

Try --hive-home /user/allus229/hive/warehouse and --hive-table retail_stage.db/departments

Thanks.

1 Like

Thanks for your reply Santy. The problem was I have not created a hive table before importing into it neither have I used --create-hive-table in the syntax. That caused the issue.