title: Hive revoke the grant err by hive.security.authorization.createtable.role.grants ( SQL Standard Based Hive Authorization )
body: <p>How to revoke the grant by hive.security.authorization.createtable.role.grants ?</p>
  
  <p>Env: </p>
  
  <p>host 172.31.10.119</p>
  
  <p>port 50033</p>
  
  <p>version apache-hive-2.3.5-bin</p>
  
  <p>database tools</p>
  
  <p>hive-site.xml </p>
  
  <pre><code>    &lt;property&gt; 
       &lt;name&gt;hive.security.authorization.createtable.role.grants&lt;/name&gt;
       &lt;value&gt;da:select;&lt;/value&gt; 
      &lt;/property&gt;
      &lt;property&gt; 
       &lt;name&gt;hive.users.in.admin.role&lt;/name&gt;
       &lt;value&gt;root,tools &lt;/value&gt; 
      &lt;/property&gt;
  </code></pre>
  
  <ol>
  <li><p>Start hiveserver2</p>
  
  <p>/opt/hive/hive-bin/bin/hiveserver2 --hiveconf hive.server2.thrift.port=50033 --hiveconf hive.server2.webui.port=10003</p></li>
  <li><p>create table </p></li>
  </ol>
  
  <pre><code>/opt/hive/hive-bin/bin/beeline -u jdbc:hive2://172.31.10.119:50033 -n tools
  </code></pre>
  
  <pre><code>use tools;
  </code></pre>
  
  <pre><code>create table test1 as select * from tools.test99 limit 10;
  </code></pre>
  
  <pre><code>show grant on table tools.test1;
  </code></pre>
  
  <pre><code>+-----------+--------------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
      | database  |    table     | partition  | column  | principal_name  | principal_type  | privilege  | grant_option  |   grant_time   | grantor  |
      +-----------+--------------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
      | tools     | test1  |            |         | da        | ROLE            | SELECT     | true          | 1565061852000  | tools    |
      +-----------+--------------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
  </code></pre>
  
  <ol start="2">
  <li>revoke select on role da</li>
  </ol>
  
  <pre><code>set role damin;
  </code></pre>
  
  <pre><code>revoke select on table tools.test1 from role da;
  </code></pre>
  
  <ol start="3">
  <li>err log</li>
  </ol>
  
  <p>FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Cannot find privilege Privilege [name=SELECT, columns=null] for Principal [name=da, type=ROLE] on Object [type=TABLE_OR_VIEW, name=tools.test1] granted by tools</p>