Search code examples
hivehiveqlbeeline

Which user is connecting to beeline?


When I connect to a beeline database, I don't need to enter the user and password, I just press enter and I get access to the database.

but when I want to write onto the database I get a permission denied error:

Error: java.io.IOException: org.apache.hadoop.security.AccessControlException: Permission denied: user=hive, access=READ, inode="/apps/hive/warehouse

I would know which default user should I use to connect to my database in order to add policies to it.

I thought that it's hive, but it seems it's not.


Solution

  • beeline takes a user account when you connect

    beeline -u 'url' -n username
    

    Use hdfs dfs -ls to find tables permissions (assuming you're not using Sentry or Ranger to manage permissions)

    In any case, you don't use beeline to add permissions. By default, it's simply HDFS user/group permissions using chmod / chown, assuming you have ACLs enabled.