Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

External Table creation error/ permission denied

avatar
Expert Contributor

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

1 ACCEPTED SOLUTION

avatar
Master Guru
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
3 REPLIES 3

avatar
Super Guru

@Tech Guy

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.

avatar
Master Guru
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
New Contributor

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?