<?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: Spark Security Using LLAP - Spark SQL Query giving error when Ranger policy restricts access in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-Security-Using-LLAP-Spark-SQL-Query-giving-error-when/m-p/218886#M60366</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/14047/karanalang.html" nodeid="14047"&gt;@Karan Alang&lt;/A&gt;&lt;P&gt;To do count(*) you need select privilege on all table. You can still do "select count(column name) from &amp;lt;table name&amp;gt;" and that will work but to run count(*) you need to have select permissions for whole table. This is working as expected.&lt;/P&gt;</description>
    <pubDate>Wed, 03 May 2017 08:55:04 GMT</pubDate>
    <dc:creator>mqureshi</dc:creator>
    <dc:date>2017-05-03T08:55:04Z</dc:date>
    <item>
      <title>Spark Security Using LLAP - Spark SQL Query giving error when Ranger policy restricts access</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-Security-Using-LLAP-Spark-SQL-Query-giving-error-when/m-p/218884#M60364</link>
      <description>&lt;P&gt;hello - I've implemented Spark security using LLAP, and seeing error in specific scenario&lt;/P&gt;&lt;P&gt;Here is what is done -&amp;gt; &lt;/P&gt;&lt;P&gt;1 - I login to Spark Thrift server using user - spark&lt;/P&gt;&lt;P&gt;2 - created a Ranger policy which specifies that user - 'spark' does not have access to column -&lt;STRONG&gt; storekey&lt;/STRONG&gt; in table - &lt;STRONG&gt;factsales&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;3 - fired query -&amp;gt; select count(1) from factsales;&lt;/P&gt;&lt;P&gt;Error is as shown below.&lt;/P&gt;&lt;P&gt;Pls. note - this seems to be happening when i try to get count of rows.&lt;/P&gt;&lt;P&gt;When i fire query to get values of specific columns, i get expected 
result (based on whether i have access to the column or not). &lt;/P&gt;&lt;P&gt;------------------------------- QUERY WHERE I GET ERROR (in getting count) --------------------&lt;/P&gt;&lt;P&gt;[alanka01@nwk2-bdp-hadoop-06 ~]$ beeline -u jdbc:hive2://&lt;A href="http://nwk2-bdp-hadoop-08.gdcs-qa.apple.com"&gt;nwk2-bdp-hadoop-08.gdcs-qa.apple.com&lt;/A&gt;:10015/default -n spark Connecting to jdbc:hive2://&lt;A href="http://nwk2-bdp-hadoop-08.gdcs-qa.apple.com"&gt;nwk2-bdp-hadoop-08.gdcs-qa.apple.com&lt;/A&gt;:10015/default
 Connected to: Spark SQL (version 1.6.2) Driver: Hive JDBC (version 
1.2.1000.2.5.3.0-37) Transaction isolation: TRANSACTION_REPEATABLE_READ 
Beeline version 1.2.1000.2.5.3.0-37 by Apache Hive 0: 
jdbc:hive2://nwk2-bdp-hadoop-08.gdcs-qa.ap&amp;gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;select count(1) 
from factsales; 
&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error: 
org.apache.spark.sql.catalyst.errors.package$TreeNodeException: execute,
 tree: TungstenAggregate(key=[], 
functions=[(count(1),mode=Final,isDistinct=false)], output=[_c0#402L]) 
+- TungstenExchange SinglePartition, None +- TungstenAggregate(key=[], 
functions=[(count(1),mode=Partial,isDistinct=false)], 
output=[count#405L]) +- Scan 
LlapRelation(org.apache.spark.sql.hive.llap.LlapContext@32b7eb41,Map(table
 -&amp;gt; default.factsales, url -&amp;gt; jdbc:hive2://&lt;A href="http://nwk2-bdp-hadoop-06.gdcs-qa.apple.com"&gt;nwk2-bdp-hadoop-06.gdcs-qa.apple.com&lt;/A&gt;:10500))[] (state=,code=0)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;-------------------------QUERIES WITH EXPECTED RESULT -1 -------------------------------------&lt;/P&gt;&lt;P&gt;0: jdbc:hive2://nwk2-bdp-hadoop-08.gdcs-qa.ap&amp;gt; &lt;/P&gt;&lt;P&gt;select saleskey from factsales limit 10; &lt;/P&gt;&lt;P&gt;+-----------+--+
| saleskey  |
+-----------+--+
| 3343549  |
| 2822385  |
| 2764012  |
| 3289348  |
| 2531906  |
| 3055870  |
| 2530527  |
| 2880758  |
| 2297049  |
| 3356058  |
+-----------+--+&lt;/P&gt;&lt;P&gt;-------------------------QUERIES WITH EXPECTED RESULT -2 (since user - spark does not have access to column - storekey) ----------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;0: jdbc:hive2://nwk2-bdp-hadoop-09.gdcs-qa.ap&amp;gt; &lt;/P&gt;&lt;P&gt;select saleskey, storekey from factsales limit 10; &lt;/P&gt;&lt;P&gt;Error: java.io.IOException: org.apache.hive.service.cli.HiveSQLException: java.io.IOException: org.apache.hadoop.hive.ql.metadata.HiveException: Failed to compile query: org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAccessControlException: Permission denied: user [spark] does not have [SELECT] privilege on [default/factsales/saleskey,storekey] (state=,code=0)&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 06:17:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-Security-Using-LLAP-Spark-SQL-Query-giving-error-when/m-p/218884#M60364</guid>
      <dc:creator>karan_alang1</dc:creator>
      <dc:date>2017-05-03T06:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Spark Security Using LLAP - Spark SQL Query giving error when Ranger policy restricts access</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-Security-Using-LLAP-Spark-SQL-Query-giving-error-when/m-p/218885#M60365</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/10969/mqureshi.html" nodeid="10969"&gt;@mqureshi&lt;/A&gt; -looping you in, any ideas ?&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 06:19:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-Security-Using-LLAP-Spark-SQL-Query-giving-error-when/m-p/218885#M60365</guid>
      <dc:creator>karan_alang1</dc:creator>
      <dc:date>2017-05-03T06:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Spark Security Using LLAP - Spark SQL Query giving error when Ranger policy restricts access</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-Security-Using-LLAP-Spark-SQL-Query-giving-error-when/m-p/218886#M60366</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/14047/karanalang.html" nodeid="14047"&gt;@Karan Alang&lt;/A&gt;&lt;P&gt;To do count(*) you need select privilege on all table. You can still do "select count(column name) from &amp;lt;table name&amp;gt;" and that will work but to run count(*) you need to have select permissions for whole table. This is working as expected.&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 08:55:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-Security-Using-LLAP-Spark-SQL-Query-giving-error-when/m-p/218886#M60366</guid>
      <dc:creator>mqureshi</dc:creator>
      <dc:date>2017-05-03T08:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Spark Security Using LLAP - Spark SQL Query giving error when Ranger policy restricts access</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-Security-Using-LLAP-Spark-SQL-Query-giving-error-when/m-p/218887#M60367</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/10969/mqureshi.html" nodeid="10969"&gt;@mqureshi&lt;/A&gt; - i guess what you mentioned makes sense, the error message, however, does not indicate the actual issue.&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 05:27:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-Security-Using-LLAP-Spark-SQL-Query-giving-error-when/m-p/218887#M60367</guid>
      <dc:creator>karan_alang1</dc:creator>
      <dc:date>2017-05-05T05:27:47Z</dc:date>
    </item>
  </channel>
</rss>

