<?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: Is there a working Python Hive library that connects to a kerberised cluster? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-there-a-working-Python-Hive-library-that-connects-to-a/m-p/167576#M41654</link>
    <description>&lt;P&gt;Found an answer on stackoverflow, can you try and validate? &lt;A href="http://stackoverflow.com/questions/29814207/python-connect-to-hive-use-pyhs2-and-kerberos-authentication" target="_blank"&gt;http://stackoverflow.com/questions/29814207/python-connect-to-hive-use-pyhs2-and-kerberos-authentication&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 24 Sep 2016 21:08:52 GMT</pubDate>
    <dc:creator>aervits</dc:creator>
    <dc:date>2016-09-24T21:08:52Z</dc:date>
    <item>
      <title>Is there a working Python Hive library that connects to a kerberised cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-there-a-working-Python-Hive-library-that-connects-to-a/m-p/167575#M41653</link>
      <description>&lt;P&gt;I have tried using the following Python libraries to connect to a kerberised Hive instance:&lt;/P&gt;&lt;P&gt;PyHive
Impyla
Pyhs2&lt;/P&gt;&lt;P&gt;None of them seem to be able to connect.&lt;/P&gt;&lt;P&gt;Here is the error message I see when using Impyla:&lt;/P&gt;&lt;PRE&gt;&amp;gt;&amp;gt;&amp;gt; from impala.dbapi import connect
&amp;gt;&amp;gt;&amp;gt; conn = connect(host='hdpmaster.hadoop',port=10000,database='default',auth_mechanism='GSSAPI',kerberos_service_name='user1')


Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
  File "/usr/local/lib/python2.7/dist-packages/impala/dbapi.py", line 147, in connect
    auth_mechanism=auth_mechanism)
  File "/usr/local/lib/python2.7/dist-packages/impala/hiveserver2.py", line 658, in connect
    transport.open()
  File "/usr/local/lib/python2.7/dist-packages/thrift_sasl/__init__.py", line 72, in open
    message=("Could not start SASL: %s" % self.sasl.getError()))
thrift.transport.TTransport.TTransportException: Could not start SASL: Error in sasl_client_start (-1) SASL(-1): generic failure: GSSAPI Error: Unspecified GSS failure.  Minor code may provide more information (Server not found in Kerberos database)
&lt;/PRE&gt;&lt;P&gt;Does anyone have a working connection string?&lt;/P&gt;&lt;P&gt;Thanks,
Dale&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2016 22:14:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-there-a-working-Python-Hive-library-that-connects-to-a/m-p/167575#M41653</guid>
      <dc:creator>daleb</dc:creator>
      <dc:date>2016-09-23T22:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a working Python Hive library that connects to a kerberised cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-there-a-working-Python-Hive-library-that-connects-to-a/m-p/167576#M41654</link>
      <description>&lt;P&gt;Found an answer on stackoverflow, can you try and validate? &lt;A href="http://stackoverflow.com/questions/29814207/python-connect-to-hive-use-pyhs2-and-kerberos-authentication" target="_blank"&gt;http://stackoverflow.com/questions/29814207/python-connect-to-hive-use-pyhs2-and-kerberos-authentication&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Sep 2016 21:08:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-there-a-working-Python-Hive-library-that-connects-to-a/m-p/167576#M41654</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-09-24T21:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a working Python Hive library that connects to a kerberised cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-there-a-working-Python-Hive-library-that-connects-to-a/m-p/167577#M41655</link>
      <description>&lt;P&gt;This connection string will work as long as the user running the script has a valid kerberos ticket:&lt;/P&gt;&lt;PRE&gt;import pyhs2

with pyhs2.connect(host='beelinehost@hadoop.com',
                    port=10000,
                    authMechanism="KERBEROS")as conn:

	with conn.cursor()as cur:
		print cur.getDatabases()&lt;/PRE&gt;&lt;P&gt;Username, password and any other configuration parameters are not passed through the KDC.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 16:00:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-there-a-working-Python-Hive-library-that-connects-to-a/m-p/167577#M41655</guid>
      <dc:creator>daleb</dc:creator>
      <dc:date>2016-09-26T16:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a working Python Hive library that connects to a kerberised cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-there-a-working-Python-Hive-library-that-connects-to-a/m-p/292764#M41656</link>
      <description>&lt;P&gt;Sigh. I've looked at literally dozens of forum posts, and every single one has a different connection string. 'this works for me'. 'that works for me'. 'you have to have thrift.py version whatever. ' 'this set of modules with these specific versions work for me.'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's hopeless. there is simply NO generalized version of an ODBC or OLEDB connection string that will work to connect to a kerberized hive 2 server. For SQL server it's so eeeasy and siiimple, and it ALWAYS works if you have the right drivers setup:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TheConnectionString = "DRIVER={SQL Server};" &amp;amp; _&lt;BR /&gt;"SERVER=servername;" &amp;amp; _&lt;BR /&gt;"Database=databasename;" &amp;amp; _&lt;BR /&gt;"UID=windowsuserid;" &amp;amp; _&lt;BR /&gt;"PWD=windowspassword"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So apparently for python connecting to hiveserver 2 you have to experiment and experiment and experiment for a long, long time trying dozens of different strings, and then one of them will FINALLY work.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 22:38:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-there-a-working-Python-Hive-library-that-connects-to-a/m-p/292764#M41656</guid>
      <dc:creator>pudnik26354</dc:creator>
      <dc:date>2020-03-27T22:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a working Python Hive library that connects to a kerberised cluster?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-there-a-working-Python-Hive-library-that-connects-to-a/m-p/306468#M41657</link>
      <description>&lt;P&gt;Yes it's a big SIGH!!! I've tried 10s and 20s of different connection strings from trying to install older verison of Python (3.7.4) so I can install sasl and pyhive and basically everything I could find out there but it's still not working yet.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, basically my setup is HIVE on Azure and the DB connections have server/host something like this "&amp;lt;server&amp;gt;.azurehdinsight.net" with port of 443. I'm using DBeaver to connect to the HIVE db and it's using JDBC URL - complete URL is something like this "jdbc:hive2://&amp;lt;server&amp;gt;.azurehdinsight.net:443/default;transportMode=http;ssl=true;httpPath=/hive2", so can someone please help me out with what packages I need in order for me to successfully query HIVE from Python?&amp;nbsp;&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/76106"&gt;@pudnik26354&lt;/a&gt;&amp;nbsp;- can you please post what worked for you? Thank you so much.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 17:15:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-there-a-working-Python-Hive-library-that-connects-to-a/m-p/306468#M41657</guid>
      <dc:creator>jaroos</dc:creator>
      <dc:date>2020-11-25T17:15:07Z</dc:date>
    </item>
  </channel>
</rss>

