Help Center/ MapReduce Service/ User Guide (Ankara Region)/ Troubleshooting/ Using Hive/ A Newly Created User Has No Query Permissions
Updated on 2024-11-29 GMT+08:00

A Newly Created User Has No Query Permissions

Symptom

When a user is created, an error message is displayed indicating that the user does not have permissions to query data.

Error: Error while compiling statement: FAILED: HiveAccessControlException Permission denied: Principal [name=hive, type=USER] does not have following privileges for operation QUERY [[SELECT] on Object [type=TABLE_OR_VIEW, name=default.t1]] (state=42000,code=40000)

Cause Analysis

The newly created user does not have the permission to operate the Hive component.

Solution

  1. Log in to FusionInsight Manager. Choose System > Permission > Role.
  2. Click Create Role, and set Role name and Description.
  3. Set Configure Resource Permission for the role and select Hive Read and Write Permission for the Hive table. All databases in the Hive column are displayed.
  4. Select the permissions required by the role and click OK.
  5. On FusionInsight Manager, choose System > Permission > User.
  6. Locate the row that contains the created user, and click Modify in the Operation column.
  7. Click Add on the right of User Group. To use the Hive service, you must add a Hive group.
  8. Click Add on the right of Role and select the role created in 4.
  9. Click OK.