Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Strange permission issue using hive jdbc

Solved Go to solution
Highlighted

Strange permission issue using hive jdbc

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

Accepted Solutions
Highlighted

Re: Strange permission issue using hive jdbc

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
Highlighted

Re: Strange permission issue using hive jdbc

@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

Highlighted

Re: Strange permission issue using hive jdbc

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

Highlighted

Re: Strange permission issue using hive jdbc

@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

Highlighted

Re: Strange permission issue using hive jdbc

Cloudera Employee

@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.

Re: Strange permission issue using hive jdbc

Contributor

@nkumar

I am using hiveserver2

Highlighted

Re: Strange permission issue using hive jdbc

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

Don't have an account?
Coming from Hortonworks? Activate your account here