You can configure related permissions if you need to access tables or databases created by other users. Hive supports column-based permission control. If a user needs to access some columns in tables created by other users, the user must be granted the permission for columns. The following describes how to grant table, column, and database permissions to users by using the role management function of MRS Manager.
Users have complete permission on the tables created by themselves in Hive and the HDFS. To access the tables created by others, they need to be granted the permission. After the Hive metadata permission is granted, the HDFS permission is automatically granted. The procedure for granting a role the permission of querying, inserting, and deleting htable data is as follows:
For versions earlier than MRS 3.x, perform the following operations to grant table permissions:
For MRS 3.x or later, perform the following operations to grant table permissions:
In role management, the procedure for granting a role the permission of querying, inserting, and deleting Hive external table data is the same. After the metadata permission is granted, the HDFS permission is automatically granted.
Users have all permissions for the tables created by themselves in Hive and HDFS. Users do not have the permission to access the tables created by others. If a user needs to access some columns in tables created by other users, the user must be granted the permission for columns. After the Hive metadata permission is granted, the HDFS permission is automatically granted. The procedure for granting a role the permission of querying and inserting data in hcol of htable is as follows:
For versions earlier than MRS 3.x, perform the following operations to grant column permissions:
For MRS 3.x or later, perform the following operations:
In role management, after the metadata permission is granted, the HDFS permission is automatically granted. Therefore, after the column permission is granted, the HDFS ACL permission for all files of the table is automatically granted.
Users have complete permission on the databases created by themselves in Hive and the HDFS. To access the databases created by others, they need to be granted the permission. After the Hive metadata permission is granted, the HDFS permission is automatically granted. The procedure for granting a role the permission of querying data and creating tables in database hdb is as follows. Other types of database operation permission are not supported.
For versions earlier than MRS 3.x, perform the following database authorization operations:
For MRS 3.x or later, perform the following operations to grant database permissions:
Scenario |
Required Permission |
---|---|
DESCRIBE TABLE |
SELECT |
SHOW PARTITIONS |
SELECT |
ANALYZE TABLE |
SELECT and INSERT |
SHOW COLUMNS |
SELECT |
SHOW TABLE STATUS |
SELECT |
SHOW TABLE PROPERTIES |
SELECT |
SELECT |
SELECT |
EXPLAIN |
SELECT |
CREATE VIEW |
SELECT, Grant Of Select, and CREATE |
SHOW CREATE TABLE |
SELECT and Grant Of Select |
CREATE TABLE |
CREATE |
ALTER TABLE ADD PARTITION |
INSERT |
INSERT |
INSERT |
INSERT OVERWRITE |
INSERT and DELETE |
LOAD |
INSERT and DELETE |
ALTER TABLE DROP PARTITION |
DELETE |
CREATE FUNCTION |
Hive Admin Privilege |
DROP FUNCTION |
Hive Admin Privilege |
ALTER DATABASE |
Hive Admin Privilege |