title: HiveAccessControlException Permission denied. [On pyhs2]
body: <p>I am trying to access data through pyhs2 by writing a select query.</p>
  
  <pre><code>import pyhs2
  
  with pyhs2.connect(host='localhost',
                 port=10000,
                 authMechanism="PLAIN",
                 user='hue',
                 password='',
                 database='default') as conn:
  
  with conn.cursor() as cur:
      print cur.getDatabases()
  
      cur.execute("select * from orders")
      print cur.getSchema()
  
      for i in cur.fetch():
          print i
  </code></pre>
  
  <p>This gives me an error:</p>
  
  <blockquote>
    <p>pyhs2.error.Pyhs2Exception: 'Error while compiling statement: FAILED: HiveAccessControlException Permission denied. Principal [name=hue, type=USER] does not have following privileges on Object [type=TABLE_OR_VIEW, name=default.orders] : [SELECT]'</p>
  </blockquote>
  
  <p>Few available answers suggested using:</p>
  
  <pre><code> grant SELECT on table orders to user hue
  </code></pre>
  
  <p>This again gives me an error:</p>
  
  <blockquote>
    <p>yhs2.error.Pyhs2Exception: 'Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Permission denied. Principal [name=hue, type=USER] does not have following privileges on Object [type=TABLE_OR_VIEW, name=default.orders] : [SELECT with grant]'</p>
  </blockquote>