Created on 08-01-2016 09:11 PM - edited 09-16-2022 03:32 AM
Hi
I am getting permission issue while creating external table. I logged in as root.
hive> create external table users ( > user_id INT, > age INT, > gender STRING, > occupation STRING, > zip_code STRING > ) > ROW FORMAT DELIMITED > FIELDS TERMINATED BY '|' > STORED AS TEXTFILE > LOCATION '/myid/userinfo'; FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:java.security.AccessControlException: Permission denied: user=root, access=WRITE, inode="/":hdfs:hdfs:drwxr-xr-x
Created 08-01-2016 09:16 PM
@Tech Guy Please take a look at this post.
You are getting a "permission denied"-error because you are trying to access a folder using "root" user that is owned by the hdfs-user and the permissions do not allow write access from others. Change owners of / to root.
sudo su - hdfs then
hdfs dfs -chown -R root /
Or if you don't want to change the permissions, launch hive using hdfs use
sudo su - hdfs
then run hive. no more permission issue.
Created 08-01-2016 09:15 PM
One option is to try first to sudo as hive (or any user that had hdfs privileges) and then launch hive and execute your DDL statement
$sudo su hive $hive
... then your DDL.
The reason is that you still need some hdfs write privileges for hive metadata.
If the response addresses your problem, vote/accept as the best answer.
Created 08-01-2016 09:16 PM
@Tech Guy Please take a look at this post.
You are getting a "permission denied"-error because you are trying to access a folder using "root" user that is owned by the hdfs-user and the permissions do not allow write access from others. Change owners of / to root.
sudo su - hdfs then
hdfs dfs -chown -R root /
Or if you don't want to change the permissions, launch hive using hdfs use
sudo su - hdfs
then run hive. no more permission issue.
Created 08-03-2019 04:25 PM
Why does it require write permissions to create an external table? If we have huge read-only data which we want the various users to query without duplicating, what should we do?