Advanced
Тема интерфейса

Using Role Management Commands

This section describes how to use basic syntax and SQL statements to manage roles.

  1. Creating a role
    CREATE Role role_name;

    role_name: name of the role to be created

  2. Granting permissions to a role
    • Grant the permissions on a specified database table.
      GRANT LOAD_PRIV ON ctl1.db1.* TO ROLE 'my_role';
    • Grant the permission to use specified resources.
      GRANT USAGE_PRIV ON RESOURCE 'spark_resource' TO ROLE 'my_role';
  3. Deleting a role
    DROP ROLE role1;
  4. Query the permissions and roles of a user.
    SHOW GRANTS;