Hive permission denied for user anonymous using beeline shell

Viewed 5487

I created a 3 node Hadoop cluster with 1 namenode and 2 datanode.

I can perform a read/write query from Hive shell, but not beeline.

I found many suggestions and answers related to this issue.
In every suggestion it was mentioned to give the permission for the userX for each individual table.
But I don't know how to set the permission for an anonymous user once and for all.

Why I am getting the user anonymous while accessing the data from beeline or from a Java program?

I am able to read the data from the both beeline shell and using Java JDBC connection.
But I can't insert the data in the table.

This is my jdbc connection : jdbc:hive2://hadoop01:10000.

Below is the error i am getting while on insert request:

Permission denied: user=anonymous, access=WRITE, inode="/user/hive/warehouse/test_log/.hive-staging_hive_2017-10-07_06-54-36_347_6034469031019245441-1":hadoop:supergroup:drwxr-xr-x

2 Answers

Beeline syntax is

beeline -n username -u "url"

I assume you are missing the username. Also, no one but the hadoop user has WRITE access to that table anyway

If you don't have full control over the table permissions, you can try relocating the staging directory with the setting hive.exec.stagingdir

Related