Created 04-16-2021 05:15 PM
Hi All,
After I tried to load data from a file in HDFS into Hive, I ran into a permission error as show below. Could you please help to let me know what I did wrong?
Thank you,
1) I uploaded a csv file: EMP.csv from my laptop into HDFS folder: /user/admin using admin credential.
2) I use Data Analytic studio to load the csv file into an external table in Hive using the code below:
CREATE EXTERNAL TABLE IF NOT EXISTS emp(
EmployeeID STRING,
FirstName STRING,
LastName STRING,
Email STRING,
PhoneNumber STRING,
HireDate STRING,
JobID STRING,
Salary STRING,
ManagerID STRING,
DepartmentID STRING
)
COMMENT 'My first Hive table'
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
STORED AS TEXTFILE
LOCATION '/user/admin/EMP.csv'
;
Here is the error:
"org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: HiveAccessControlException Permission denied: user [hive] does not have [ALL] privilege on [hdfs://sandbox-hdp.hortonworks.com:8020/user/admin/EMP.csv]"
Created 04-18-2021 07:37 PM
Hello
a quick fix is to put the csv file under the hive folder instead of the admin folder
Created 04-18-2021 09:34 PM
Hi Xue,
Thanks for replying my question. After I have tried the solution, I ran into another security issue as show in the screen shot.
I have tried the HDP_2.6.5. Everything works just fine and the Ambari user interface is more easier to use.
Thanks again,
Created 04-18-2021 09:55 PM
Hello
A quick fix is to use hive user not admin user
Created 04-18-2021 10:43 PM
@TDStephanieSoft If you are using Ranger kindly check if you have necessary permission for hive user in the HDFS policy for the path '/user/admin/EMP.csv'. Also check whether the hive use has read, write and execute permission in the HDFS location '/user/admin/EMP.csv'
Thanks!
Created 04-19-2021 08:59 AM
After I have checked the permission in Ranger, I noticed that there isn't any policy setup for hive user. I did add a policy to allow access to the folder /user/admin in HDFS to hive user. The problem is I cannot save the new policy due to another security error as show below.
I wonder if the Hortonworks Sandbox HDP 3.0 that I downloaded is working version 😞