- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Strange permission issue using hive jdbc
- Labels:
-
Apache Hive
Created ‎10-16-2017 05:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Created ‎10-16-2017 07:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Created ‎10-16-2017 05:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Created ‎10-16-2017 07:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Created ‎10-16-2017 07:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Created ‎10-16-2017 06:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@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.
Created ‎10-16-2017 07:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using hiveserver2
Created ‎10-16-2017 07:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
