Permission Denied when using scoop to import data from mysql to hive db

Hi ,

I am getting this error when running scoop import to import tables from MySQL db to hive database

Job job_1480307771710_2561 failed with state FAILED due to: Job setup failed : org.apache.hadoop.secur
ity.AccessControlException: Permission denied: user=hardialsingh, access=WRITE, inode="/user/hive/warehouse/hs_retail_stage.db/_temporary/1"
:hive:hdfs:drwxr-xr-x

@hardialsingh - Could you please past your sqoop import code

Where are you running this code?

i am running sqoop import in web console terminal

sqoop import --connect “jdbc:mysql://nn01.itversity.com:3306/retail_db” --username retail_dba --password itver
sity --table departments --as-avrodatafile --warehouse-dir=/user/hive/warehouse/hs_retail_stage.db -m 2

@hardialsingh - You are missing below parameters if you want to import directly into hive tables.
–hive-import
–hive-overwrite
–create-hive-table

Default it will store into \user\hive\warehouse
you want to store into your database then use
–hive-home /user/hive/warehouse/hs_retail_stage.db
or
–hive-database hs_retail_stage.db

Below is the reference for more details…

Hope this helps!

1 Like

able to run sqoop job now … i was using wrong hive warehouse path it should be /apps/hive/warehouse

1 Like