<?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 How to connect to Hive with pyhive on Windows in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-connect-to-Hive-with-pyhive-on-Windows/m-p/327136#M229978</link>
    <description>&lt;P&gt;I've been racking my brain for the past couple of days attempting to connect to a Hive server with a Python client using pyhive on Windows. I'm new to Hive (pyhive too for that matter), but am a reasonably experienced Python dev. Invariably I get the following error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(pyhive-test) C:\dev\sandbox\pyhive-test&amp;gt;python test.py
Traceback (most recent call last):
File "test.py", line 3, in &amp;lt;module&amp;gt;
conn = hive.Connection(host='192.168.1.196', port='10000', database='default', auth='NONE')
File "C:\Users\harnerd\Anaconda3\envs\pyhive-test\lib\site-packages\pyhive\hive.py", line 192, in __init__
self._transport.open()
File "C:\Users\harnerd\Anaconda3\envs\pyhive-test\lib\site-packages\thrift_sasl\__init__.py", line 84, in open
raise TTransportException(type=TTransportException.NOT_OPEN,
thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable to find a callback: 2'&lt;/LI-CODE&gt;&lt;P&gt;when executing the following script:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from pyhive import hive

conn = hive.Connection(host='192.168.1.196', port='10000', database='default', auth='NONE')
cur = conn.cursor()
cur.execute('show tables')
data = cur.fetchall()
print(data)
&lt;/LI-CODE&gt;&lt;P&gt;The HiveServer2 instance is an out-of-the-box HDP Sandbox VM from Cloudera with HiveServer2 Authentication set to 'None'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Client is an Anaconda virtual environment on Windows 10 with Python 3.8.5 and the following packages installed by conda:&lt;/P&gt;&lt;P&gt;- pyhive 0.6.1&lt;BR /&gt;- sasl 0.2.1&lt;BR /&gt;- thrift 0.13.0&lt;BR /&gt;- thrift-sasl 0.4.2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now I'm merely trying to connect to Hive with the script above, but ultimately I intend to use pyhive within SQLAlchemy in a Flask application. In other words: Flask -&amp;gt; Flask-SQLAlchemy -&amp;gt; SQLAlchemy -&amp;gt; pyhive. In production the Flask app will be hosted by Cloudera Data Science Workbench (i.e. some flavor of Linux), but will be developed (and therefore must also run) on Windows systems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course I've looked at the many questions here, on Cloudera's site, and GitHub relating to Hive connection problems and if someone put a gun to my head I would have to say that trying this from a Windows client may be part of the problem as that doesn't seem to be a very common thing to do.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Oct 2021 14:47:31 GMT</pubDate>
    <dc:creator>Dan112358</dc:creator>
    <dc:date>2021-10-08T14:47:31Z</dc:date>
    <item>
      <title>How to connect to Hive with pyhive on Windows</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-connect-to-Hive-with-pyhive-on-Windows/m-p/327136#M229978</link>
      <description>&lt;P&gt;I've been racking my brain for the past couple of days attempting to connect to a Hive server with a Python client using pyhive on Windows. I'm new to Hive (pyhive too for that matter), but am a reasonably experienced Python dev. Invariably I get the following error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(pyhive-test) C:\dev\sandbox\pyhive-test&amp;gt;python test.py
Traceback (most recent call last):
File "test.py", line 3, in &amp;lt;module&amp;gt;
conn = hive.Connection(host='192.168.1.196', port='10000', database='default', auth='NONE')
File "C:\Users\harnerd\Anaconda3\envs\pyhive-test\lib\site-packages\pyhive\hive.py", line 192, in __init__
self._transport.open()
File "C:\Users\harnerd\Anaconda3\envs\pyhive-test\lib\site-packages\thrift_sasl\__init__.py", line 84, in open
raise TTransportException(type=TTransportException.NOT_OPEN,
thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable to find a callback: 2'&lt;/LI-CODE&gt;&lt;P&gt;when executing the following script:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from pyhive import hive

conn = hive.Connection(host='192.168.1.196', port='10000', database='default', auth='NONE')
cur = conn.cursor()
cur.execute('show tables')
data = cur.fetchall()
print(data)
&lt;/LI-CODE&gt;&lt;P&gt;The HiveServer2 instance is an out-of-the-box HDP Sandbox VM from Cloudera with HiveServer2 Authentication set to 'None'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Client is an Anaconda virtual environment on Windows 10 with Python 3.8.5 and the following packages installed by conda:&lt;/P&gt;&lt;P&gt;- pyhive 0.6.1&lt;BR /&gt;- sasl 0.2.1&lt;BR /&gt;- thrift 0.13.0&lt;BR /&gt;- thrift-sasl 0.4.2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now I'm merely trying to connect to Hive with the script above, but ultimately I intend to use pyhive within SQLAlchemy in a Flask application. In other words: Flask -&amp;gt; Flask-SQLAlchemy -&amp;gt; SQLAlchemy -&amp;gt; pyhive. In production the Flask app will be hosted by Cloudera Data Science Workbench (i.e. some flavor of Linux), but will be developed (and therefore must also run) on Windows systems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course I've looked at the many questions here, on Cloudera's site, and GitHub relating to Hive connection problems and if someone put a gun to my head I would have to say that trying this from a Windows client may be part of the problem as that doesn't seem to be a very common thing to do.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 14:47:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-connect-to-Hive-with-pyhive-on-Windows/m-p/327136#M229978</guid>
      <dc:creator>Dan112358</dc:creator>
      <dc:date>2021-10-08T14:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect to Hive with pyhive on Windows</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-connect-to-Hive-with-pyhive-on-Windows/m-p/398010#M250038</link>
      <description>&lt;P&gt;I'm 3 years late, but in case anyone else facing the same issue, try using &lt;STRONG&gt;auth='NOSASL'.&lt;BR /&gt;&lt;/STRONG&gt;Maybe the issue does not occur with newer versions.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 08:06:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-connect-to-Hive-with-pyhive-on-Windows/m-p/398010#M250038</guid>
      <dc:creator>smruti</dc:creator>
      <dc:date>2024-11-26T08:06:56Z</dc:date>
    </item>
  </channel>
</rss>

