Support Questions

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

Strange permission issue using hive jdbc

avatar
Contributor

I am running a simple select query that fails on some strange permission issue. I am connecting with specific user and password.

see log attached.hive-jdbc-permissions-error.txt

1 ACCEPTED SOLUTION

avatar
Contributor

Turns out that the user password property names sent to the hive driver in connProps:

Connection connection = hiveDriver.connect(serverURL, connProps);


were wrong. so the user and password info wasn't sent out.

once fixed - the query works.

View solution in original post

6 REPLIES 6

avatar
Super Guru

@Yair Ogen,

Your directory has below permissions. User anonymous doesn't have write permissions on the folder

/user/anonymous : hdfs:hdfs:drwxr-xr-x

Change the ownership of the directory or give write permissions on the dir

1) hdfs dfs -chmod 777 /user/anonymous

2)hdfs dfs -chown anonymous:hdfs /user/anonymous

Thanks,

Aditya

avatar
Contributor

@Aditya Sirna

Thing is I don't know where this 'anonymous' came from (as I am using admin user) and I don't even have a folder named /user/anonymous

avatar
Super Guru

@Yair Ogen

I guess you are running it through beeline without passing the -n (username) param. You need to create /user/anonymous folder and change permissions as mentioned above to make it work. Or pass the valid username.

Thanks,

Aditya

avatar
Contributor

@Yair Ogen,

Can you let me know if you are trying the execute query using hiveserveer 1 or hiveserver2 ?

If it is hiveserver1, then please change this in hive config- hive.servere2.enable.doAs= true

The issue looks to be related to the user who is being used to execute the particular hive query. On enabling the above config param, for hiverserver1, it enables to execute as the end user rather then expecting as hive user.

avatar
Contributor

@nkumar

I am using hiveserver2

avatar
Contributor

Turns out that the user password property names sent to the hive driver in connProps:

Connection connection = hiveDriver.connect(serverURL, connProps);


were wrong. so the user and password info wasn't sent out.

once fixed - the query works.