GRANT Statement (Impala 2.0 or higher only)
       The
        GRANT statement grants a privilege on a specified object
      to a role or grants a role to a group.
    
Syntax:
GRANT ROLE role_name TO GROUP group_name
GRANT privilege ON object_type object_name
   TO [ROLE] roleName
   [WITH GRANT OPTION]
privilege ::= ALL | ALTER | CREATE | DROP | INSERT | REFRESH | SELECT | SELECT(column_name)
object_type ::= TABLE | DATABASE | SERVER | URI
Typically, the object name is an identifier. For URIs, it is a string literal.
Required privileges:
Only administrative users (initially, a predefined set of users specified in the Sentry service configuration file) can use this statement.
Only Sentry administrative users can grant roles to a group.
 The WITH GRANT OPTION clause allows members of the
      specified role to issue GRANT and REVOKE
      statements for those same privileges Hence, if a role has the
        ALL privilege on a database and the WITH GRANT
        OPTION set, users granted that role can execute
        GRANT/REVOKE statements only for that
      database or child tables of the database. This means a user could revoke
      the privileges of the user that provided them the GRANT
        OPTION. 
 Impala does not currently support revoking only the WITH GRANT
        OPTION from a privilege previously granted to a role. To remove
      the WITH GRANT OPTION, revoke the privilege and grant it
      again without the WITH GRANT OPTION flag. 
      The ability to grant or revoke SELECT privilege on specific columns is available
      in Impala 2.3 and higher. See the documentation for Apache Sentry for details.
    
Usage notes:
      You can only grant the ALL privilege to the
        URI object. Finer-grained privileges mentioned below on
      a URI are not supported.
    
| Privilege | Scope | SQL Allowed to Execute | 
|---|---|---|
| REFRESH | SERVER | INVALIDATE METADATAon all tables in all
                databases
 | 
| REFRESH | DATABASE | INVALIDATE METADATAon all tables in the
            named database
 | 
| REFRESH | TABLE | INVALIDATE METADATAon the named
                table
 | 
| CREATE | SERVER | CREATE DATABASEon all
                databases
 | 
| CREATE | DATABASE | CREATE TABLEon all tables in the named
            database | 
| DROP | SERVER | DROP DATBASEon all databases
 | 
| DROP | DATABASE | DROP DATABASEon the named
                database
 | 
| DROP | TABLE | DROP TABLEon the named table | 
| ALTER | SERVER | ALTER TABLEon all tables | 
| ALTER | DATABASE | ALTER TABLEon the tables in the named
            database | 
| ALTER | TABLE | ALTER TABLEon the named table | 
- 
              ALTER TABLE RENAMErequires theALTERprivilege at theTABLElevel and theCREATEprivilege at theDATABASElevel.
- 
              CREATE TABLE AS SELECTrequires theCREATEprivilege on the database that should contain the new table and theSELECTprivilege on the tables referenced in the query portion of the statement.
- 
              COMPUTE STATSrequires theALTERandSELECTprivileges on the target table.
Compatibility:
- 
          The Impala GRANTandREVOKEstatements are available in Impala 2.0 and later.
- 
          In Impala 1.4 and later, Impala can make use of any roles and privileges specified by the
          GRANTandREVOKEstatements in Hive, when your system is configured to use the Sentry service instead of the file-based policy mechanism.
- 
          The Impala GRANTandREVOKEstatements for privileges do not require theROLEkeyword to be repeated before each role name, unlike the equivalent Hive statements.
- 
          Currently, each Impala GRANTorREVOKEstatement can only grant or revoke a single privilege to or from a single role.
Cancellation: Cannot be cancelled.
HDFS permissions: This statement does not touch any HDFS files or directories, therefore no HDFS permissions are required.
Kudu considerations:
- 
            Only users with the ALLprivilege onSERVERcan create external Kudu tables.
- 
            The ALLprivileges onSERVERis required to specify thekudu.master_addressesproperty in theCREATE TABLEstatements for managed tables as well as external tables.
- Access to Kudu tables is enforced at the table level and at the column level.
- 
            The SELECT- andINSERT-specific permissions are supported.
- 
            The DELETE,UPDATE, andUPSERToperations require theALLprivilege.
Related information:
Enabling Sentry Authorization for Impala, REVOKE Statement (Impala 2.0 or higher only), CREATE ROLE Statement (Impala 2.0 or higher only), DROP ROLE Statement (Impala 2.0 or higher only), SHOW Statement