Security
Also available as:
PDF
loading table of contents...

Provide User Access to Hive Database Tables from the Command Line

Hive provides the means to manage user access to Hive database tables directly from the command line. The most commonly-used commands are:

  • GRANT

    Syntax:

    grant <permissions> on table <table> to user <user or group>;

    For example, to create a policy that grants user1 SELECT permission on the table default-hivesmoke22074, the command would be:

    grant select on table default.hivesmoke22074 to user user1;

    The syntax is the same for granting UPDATE, CREATE, DROP, ALTER, INDEX, LOCK, ALL, and ADMIN rights.

  • REVOKE

    Syntax:

    revoke <permissions> on table <table> from user <user or group>;

    For example, to revoke the SELECT rights of user1 to the table default.hivesmoke22074, the command would be:

    revoke select on table default.hivesmoke22074 from user user1;

    The syntax is the same for revoking UPDATE, CREATE, DROP, ALTER, INDEX, LOCK, ALL, and ADMIN rights.