<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: INSERT only permission not working : &amp;quot;does not have privileges for QUERY&amp;quot; , _tmp_table in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52558#M57466</link>
    <description>&lt;P&gt;Well, I personaly tends to think this is a small "overlooked" use case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I mean, this particular query syntax is doing some "weird" things in Hive under the hood (it creates a table and reads it) and sentry seems to not be expecting it.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Mar 2017 09:51:34 GMT</pubDate>
    <dc:creator>mathieu.d</dc:creator>
    <dc:date>2017-03-23T09:51:34Z</dc:date>
    <item>
      <title>INSERT only permission not working : "does not have privileges for QUERY" , _tmp_table issue ?!?!</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52384#M57457</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am playing around with Sentry and want to provide "write-only" permission to a user via&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;grant insert ON default.shipment_test TO ROLE ingester;&lt;/PRE&gt;&lt;P&gt;But if I connect to hive via beeline and execute an insert statement, I receive the error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;0: jdbc:hive2://quickstart.cloudera:10000/def&amp;gt; insert into shipment_test values (1,'1111');
Error: Error while compiling statement: FAILED: SemanticException No valid privileges
 User writer does not have privileges for QUERY
 The required privileges: Server=server1-&amp;gt;Db=default-&amp;gt;Table=values__tmp__table__2-&amp;gt;Column=tmp_values_col1-&amp;gt;action=select; (state=42000,code=40000)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The environment is CDH sandbox 5.8&lt;/P&gt;&lt;P&gt;Linux user 'writer' is member of group 'ingester';&lt;/P&gt;&lt;P&gt;The group 'ingester' is assigned to the proper role in Sentry&amp;nbsp;and was given the INSERT privilege:&lt;/P&gt;&lt;PRE&gt;grant role sentry_ingester to group ingester;&lt;BR /&gt;grant INSERT &lt;SPAN&gt;ON default.&lt;/SPAN&gt;&lt;SPAN&gt;shipment_test&lt;/SPAN&gt;&lt;SPAN&gt; TO ROLE sentry_ingester;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why the statement errors out due to a "select" issue on a tmp table ?!?!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I have to specify some more privileges, or how do you grant "INSERT"-only permissions to a group ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 11:17:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52384#M57457</guid>
      <dc:creator>geko</dc:creator>
      <dc:date>2022-09-16T11:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT only permission not working : "does not have privileges for QUERY" , _tmp_table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52386#M57458</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/336"&gt;@geko&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should also consider the permission in folder owner/group where the data will be stored&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 17:48:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52386#M57458</guid>
      <dc:creator>saranvisa</dc:creator>
      <dc:date>2017-03-20T17:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT only permission not working : "does not have privileges for QUERY" , _tmp_table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52389#M57459</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/18441"&gt;@saranvisa&lt;/a&gt;&amp;nbsp;for replying.&lt;/P&gt;&lt;P&gt;But the HDFS permissions should be adjusted by Sentry itself, since HDFS sync is enabled, right ?&lt;/P&gt;&lt;P&gt;Nevertheless, HDFS permissions look like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;# file: /user/hive/warehouse/shipment_test
# owner: hive
# group: hive
group:ingester:-wx&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Mar 2017 19:04:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52389#M57459</guid>
      <dc:creator>geko</dc:creator>
      <dc:date>2017-03-20T19:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT only permission not working : "does not have privileges for QUERY" , _tmp_table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52398#M57460</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/336"&gt;@geko&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Until you familiar with available roles/privileges, I would recommend you to use&amp;nbsp;Sentry from Hue. it will auto fill all the available options (or) you just need to choose the available options. It will make your life easier&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pre-request: Make sure your linux users/groups are exactly matches to Hue users/groups&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 20:23:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52398#M57460</guid>
      <dc:creator>saranvisa</dc:creator>
      <dc:date>2017-03-20T20:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT only permission not working : "does not have privileges for QUERY" , _tmp_table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52515#M57461</link>
      <description>&lt;P&gt;From the error message I understand the issue is more about the &lt;STRONG&gt;temporary table created for selecting the data&lt;/STRONG&gt; (and not about read permissions on the folder of the target table).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure "how" sentry is supposed to handle this case. Guess I'll run some test since I'm curious about this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 15:56:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52515#M57461</guid>
      <dc:creator>mathieu.d</dc:creator>
      <dc:date>2017-03-22T15:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT only permission not working : "does not have privileges for QUERY" , _tmp_table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52517#M57462</link>
      <description>&lt;P&gt;I have run some tests.&lt;/P&gt;&lt;P&gt;And indeed, the problem seems to be around the temporary table (at least, it is failing here before anything else).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The query you make with the "VALUES" part work like this :&lt;/P&gt;&lt;P&gt;- it create a temporary hive table with the line to be inserted&lt;/P&gt;&lt;P&gt;- it query that temporary table for inserting the data into the target table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From what I see, the temporary table is created. But the user do not have "select" permission on it.&lt;/P&gt;&lt;P&gt;Surprisingly sentry allow for the creation but not the select.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess that a workaround would be to grant "SELECT" on the database "default" but this could bring some issues for you (since the user will have read permission on all the tables inside "default").&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seems like a defect to me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 16:40:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52517#M57462</guid>
      <dc:creator>mathieu.d</dc:creator>
      <dc:date>2017-03-22T16:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT only permission not working : "does not have privileges for QUERY" , _tmp_table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52518#M57463</link>
      <description>&lt;P&gt;Thanks for jumping in here &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/11415"&gt;@mathieu.d&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/18441"&gt;@saranvisa&lt;/a&gt;&amp;nbsp;: I did further playaround in this 5.8 sandbox, and even using the Hue=&amp;gt;Security UI produces the same error/issue. What I did:&lt;/P&gt;&lt;P&gt;- created 2 groups in Linux (one for read-only, the other for read-write) and added users to it&lt;/P&gt;&lt;P&gt;- created 2 roles in sentry (again, one for read-only and the other for read-write) and granted corresponding previously created group to it&lt;/P&gt;&lt;P&gt;- created a hive database "sentrydemo" and one table in it&lt;/P&gt;&lt;P&gt;- open 2 terminals with 2 different users (one 'read', and one 'read-write') and connect to hive via beeline&lt;/P&gt;&lt;P&gt;- "select * from hivetablename" works fine&lt;/P&gt;&lt;P&gt;- "insert into hivetablename values (100, 'test entry')" gives me the following error:&lt;/P&gt;&lt;PRE&gt; The required privileges: Server=server1-&amp;gt;Db=sentrydemo-&amp;gt;Table=values__tmp__table__2-&amp;gt;Column=tmp_values_col1-&amp;gt;action=select; (state=42000,code=40000)&lt;/PRE&gt;&lt;P&gt;"Enable Sentry synchronisation" is enabled in HDFS config, the "real" table folders have the correct permissions set according to the groups.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where are those "values__tmp__table..." 's are being stored and why are they not being considered by the Sentry permissions I defined ?!?!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas ? At the end it is not either just a "INSERT only permission not working", right now it is a general "INSERT" not working issue, since the "read-write" group has privileges "SELECT" &amp;amp; "INSERT"&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 16:43:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52518#M57463</guid>
      <dc:creator>geko</dc:creator>
      <dc:date>2017-03-22T16:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT only permission not working : "does not have privileges for QUERY" , _tmp_table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52519#M57464</link>
      <description>&lt;P&gt;Yes, not suprised by the outcome of your test since the issue is about "read" permission on the temporary table and not the target table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you try the following, it should work for your test :&lt;/P&gt;&lt;P&gt;Give "SELECT" permission on the database and retry. This time it should work and confirm the "problem".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And since you wonder, the problem isn't on the HDFS permission part. It's sentry side permissions issue.&lt;/P&gt;&lt;P&gt;The user that is accessing and writing the data on HDFS is "hive" anyway (since the impersonification should be disabled).&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 16:51:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52519#M57464</guid>
      <dc:creator>mathieu.d</dc:creator>
      <dc:date>2017-03-22T16:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT only permission not working : "does not have privileges for QUERY" , _tmp_table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52520#M57465</link>
      <description>&lt;P&gt;thanks for this hint.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can confirm by providing SELECT privileges on db level, the INSERT works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From a security perspective this looks a bit weird. Is this a known bug ?!?!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 17:15:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52520#M57465</guid>
      <dc:creator>geko</dc:creator>
      <dc:date>2017-03-22T17:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT only permission not working : "does not have privileges for QUERY" , _tmp_table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52558#M57466</link>
      <description>&lt;P&gt;Well, I personaly tends to think this is a small "overlooked" use case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I mean, this particular query syntax is doing some "weird" things in Hive under the hood (it creates a table and reads it) and sentry seems to not be expecting it.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 09:51:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52558#M57466</guid>
      <dc:creator>mathieu.d</dc:creator>
      <dc:date>2017-03-23T09:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT only permission not working : "does not have privileges for QUERY" , _tmp_table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52572#M57467</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/11415"&gt;@mathieu.d&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;do you think this needs to be raised as an issue/bug , or is my case that unusual (I don't think so, honestly &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; )?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 12:01:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52572#M57467</guid>
      <dc:creator>geko</dc:creator>
      <dc:date>2017-03-23T12:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT only permission not working : "does not have privileges for QUERY" , _tmp_table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52619#M57468</link>
      <description>&lt;P&gt;I do think this is a defect. Not sure how Cloudera will see it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But to be fair, this particular way of inserting data (with the VALUES syntax) into a table is pretty much limited to small testing.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 12:48:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/INSERT-only-permission-not-working-quot-does-not-have/m-p/52619#M57468</guid>
      <dc:creator>mathieu.d</dc:creator>
      <dc:date>2017-03-24T12:48:42Z</dc:date>
    </item>
  </channel>
</rss>

