<?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: How to connect hive using Python for pytest databases in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-connect-hive-using-Python-for-pytest-databases/m-p/403433#M252068</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/124448"&gt;@Maulz&lt;/a&gt;&amp;nbsp;- You can use Knox as a proxy through the &lt;FONT face="courier new,courier"&gt;&lt;EM&gt;cdp-proxy-api&lt;/EM&gt;&amp;nbsp;&lt;/FONT&gt;topology to connect to Hive or Impala with basic authentication (username/password) like Hue. Using "cdp-proxy-api" assumes Knox is configured for basic authentication instead of SAML or JWT, etc. If it's not, you can manually create a new topology for basic authentication with hive. Here's how to&amp;nbsp;enable Knox to expose Hive with the cdp-proxy-api if it's not configured yet (perhaps select "all" for transport mode:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.cloudera.com/cdp-private-cloud-base/7.3.1/securing-hive/topics/hive_secure_knox.html" target="_blank" rel="noopener"&gt;https://docs.cloudera.com/cdp-private-cloud-base/7.3.1/securing-hive/topics/hive_secure_knox.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It sounds like you have both AD and MIT KDC. If your user you want to use hive with is in the MIT KDC realm, not AD,&amp;nbsp; you can use a different krb5.conf file, or you can set up a on-way trust between AD and MIT KDC.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You can create your own krb5.conf configured for MIT KDC (or even configured for the one-way-trust, but the trust has to be established between the AD and MIT KDCs).&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;export KRB5_CONFIG=/path/to/your/custom_krb5.conf&lt;/FONT&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;You can use the default ticket cache file in the krb5.conf&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;default_ccache_name = FILE:/tmp/krb5cc_%{uid}&amp;nbsp;&amp;nbsp;&lt;/EM&gt;&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;or set it as an environment variable (&lt;FONT face="courier new,courier"&gt;KRB5CCNAME&lt;/FONT&gt;).&lt;BR /&gt;Of course you'll need these set for python as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Mar 2025 13:43:15 GMT</pubDate>
    <dc:creator>james_jones</dc:creator>
    <dc:date>2025-03-03T13:43:15Z</dc:date>
    <item>
      <title>How to connect hive using Python for pytest databases</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-connect-hive-using-Python-for-pytest-databases/m-p/403224#M251970</link>
      <description>&lt;P&gt;Hello Everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a Data Quality professional at a company, and currently, I am developing automated data testing. However, at this initial stage, I am facing difficulties in connecting Python to Cloudera/Hue/Hive.&lt;/P&gt;&lt;P&gt;In manual scenarios, I usually connect to Cloudera/Hue through a web portal like this:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://demo.gethue.com/hue/editor/?type=hive" target="_blank" rel="noopener noreferrer"&gt;https://demo.gethue.com/hue/editor/?type=hive&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Is there anyone here who can assist me?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2026 06:21:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-connect-hive-using-Python-for-pytest-databases/m-p/403224#M251970</guid>
      <dc:creator>Maulz</dc:creator>
      <dc:date>2026-04-21T06:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect hive using Python for pytest databases</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-connect-hive-using-Python-for-pytest-databases/m-p/403233#M251973</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/124448"&gt;@Maulz&lt;/a&gt;&amp;nbsp;Welcome to the Cloudera Community!&lt;BR /&gt;&lt;BR /&gt;To help you get the best possible solution, I have tagged our Hive experts&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/45798"&gt;@james_jones&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/92016"&gt;@ggangadharan&lt;/a&gt;&amp;nbsp; who may be able to assist you further.&lt;BR /&gt;&lt;BR /&gt;Please keep us updated on your post, and we hope you find a satisfactory solution to your query.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 15:51:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-connect-hive-using-Python-for-pytest-databases/m-p/403233#M251973</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2025-02-28T15:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect hive using Python for pytest databases</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-connect-hive-using-Python-for-pytest-databases/m-p/403249#M251981</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/124448"&gt;@Maulz&lt;/a&gt;&amp;nbsp;- Check this document for how to query hive from python3. You don't need Hue for this.&amp;nbsp;&amp;nbsp;&lt;A href="https://docs.cloudera.com/cdsw/1.10.5/import-data/topics/cdsw-accessing-data-from-apache-hive.html" target="_blank"&gt;https://docs.cloudera.com/cdsw/1.10.5/import-data/topics/cdsw-accessing-data-from-apache-hive.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This example is for using Kerberos, but you can change or remove the authentication settings, depending on your authentication requiremnts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 19:55:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-connect-hive-using-Python-for-pytest-databases/m-p/403249#M251981</guid>
      <dc:creator>james_jones</dc:creator>
      <dc:date>2025-02-28T19:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect hive using Python for pytest databases</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-connect-hive-using-Python-for-pytest-databases/m-p/403367#M252047</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/45798"&gt;@james_jones&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand what you mean, but can I access it using Python with the LDAP method like Hue?&lt;/P&gt;&lt;P&gt;My reason Since using Kerberos, I encounter issues when creating a ticket in MIT Kerberos that conflicts with my Microsoft AD user. So, I am looking for an &lt;STRONG&gt;alternative option without using Kerberos MIT&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Is it possible?&lt;/P&gt;</description>
      <pubDate>Sun, 02 Mar 2025 14:08:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-connect-hive-using-Python-for-pytest-databases/m-p/403367#M252047</guid>
      <dc:creator>Maulz</dc:creator>
      <dc:date>2025-03-02T14:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect hive using Python for pytest databases</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-connect-hive-using-Python-for-pytest-databases/m-p/403433#M252068</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/124448"&gt;@Maulz&lt;/a&gt;&amp;nbsp;- You can use Knox as a proxy through the &lt;FONT face="courier new,courier"&gt;&lt;EM&gt;cdp-proxy-api&lt;/EM&gt;&amp;nbsp;&lt;/FONT&gt;topology to connect to Hive or Impala with basic authentication (username/password) like Hue. Using "cdp-proxy-api" assumes Knox is configured for basic authentication instead of SAML or JWT, etc. If it's not, you can manually create a new topology for basic authentication with hive. Here's how to&amp;nbsp;enable Knox to expose Hive with the cdp-proxy-api if it's not configured yet (perhaps select "all" for transport mode:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.cloudera.com/cdp-private-cloud-base/7.3.1/securing-hive/topics/hive_secure_knox.html" target="_blank" rel="noopener"&gt;https://docs.cloudera.com/cdp-private-cloud-base/7.3.1/securing-hive/topics/hive_secure_knox.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It sounds like you have both AD and MIT KDC. If your user you want to use hive with is in the MIT KDC realm, not AD,&amp;nbsp; you can use a different krb5.conf file, or you can set up a on-way trust between AD and MIT KDC.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You can create your own krb5.conf configured for MIT KDC (or even configured for the one-way-trust, but the trust has to be established between the AD and MIT KDCs).&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;export KRB5_CONFIG=/path/to/your/custom_krb5.conf&lt;/FONT&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;You can use the default ticket cache file in the krb5.conf&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;default_ccache_name = FILE:/tmp/krb5cc_%{uid}&amp;nbsp;&amp;nbsp;&lt;/EM&gt;&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;or set it as an environment variable (&lt;FONT face="courier new,courier"&gt;KRB5CCNAME&lt;/FONT&gt;).&lt;BR /&gt;Of course you'll need these set for python as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 13:43:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-connect-hive-using-Python-for-pytest-databases/m-p/403433#M252068</guid>
      <dc:creator>james_jones</dc:creator>
      <dc:date>2025-03-03T13:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect hive using Python for pytest databases</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-connect-hive-using-Python-for-pytest-databases/m-p/403729#M252184</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/124448"&gt;@Maulz&lt;/a&gt;&amp;nbsp;Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future. Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 15:46:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-connect-hive-using-Python-for-pytest-databases/m-p/403729#M252184</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2025-03-07T15:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect hive using Python for pytest databases</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-connect-hive-using-Python-for-pytest-databases/m-p/403764#M252186</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/124448"&gt;@Maulz&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;Connecting Python to Cloudera, Hive, and Hue involves using libraries and drivers that interface with HiveServer2&amp;nbsp; the service that allows remote clients to execute Hive queries.There are several methods to connect Python to Cloudera's ecosystem, particularly to access Hive tables through Hue.&amp;nbsp;I'll detail the most common approaches.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;H3&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Prerequisites&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;Cloudera/Hadoop Cluster&lt;/STRONG&gt;: Ensure HiveServer2 is running on your cluster.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;Default HiveServer2 port:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;10000&amp;nbsp;(&lt;EM&gt;&lt;STRONG&gt;verify via Cloudera Manager&lt;/STRONG&gt;&lt;/EM&gt;).&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Python Environment&lt;/STRONG&gt;: Python 3.6+ installed.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Authentication&lt;/STRONG&gt;&lt;SPAN&gt;: Know your authentication method:&lt;/SPAN&gt;&lt;UL&gt;&lt;LI&gt;Username/password (non-secure).&lt;/LI&gt;&lt;LI&gt;Kerberos (common in enterprise clusters).&lt;/LI&gt;&lt;LI&gt;LDAP.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Below is a detailed, step-by-step guide:&lt;/P&gt;&lt;H3&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;2. Install Required Python Libraries&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;P&gt;Use&amp;nbsp;pip&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to install:&lt;/P&gt;&lt;LI-SPOILER&gt;pip install pyhive # Python interface for Hive&lt;BR /&gt;pip install thrift # Thrift protocol support&lt;BR /&gt;pip install sasl # SASL authentication (for Kerberos)&lt;BR /&gt;pip install thrift-sasl # SASL wrapper for Thrift&lt;BR /&gt;pip install pykerberos # Kerberos support (if needed)&lt;/LI-SPOILER&gt;&lt;P&gt;&lt;SPAN&gt;For JDBC-based connections (alternative method):&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-SPOILER&gt;pip install JayDeBeApi # JDBC bridge&lt;/LI-SPOILER&gt;&lt;H3&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;3. Configure Cloudera/Hive&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;H4&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;Via Cloudera Manager&lt;/STRONG&gt;:&lt;/FONT&gt;&lt;/H4&gt;&lt;OL&gt;&lt;LI&gt;Enable&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;HiveServer2&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and ensure it’s running.&lt;/LI&gt;&lt;LI&gt;Check&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;HiveServer2 Port&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(default:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;10000).&lt;/LI&gt;&lt;LI&gt;If using Kerberos:&lt;/LI&gt;&lt;/OL&gt;&lt;UL&gt;&lt;LI&gt;Ensure&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Kerberos&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is configured in Cloudera.&lt;/LI&gt;&lt;LI&gt;Export your Kerberos keytab&lt;/LI&gt;&lt;/UL&gt;&lt;LI-SPOILER&gt;kinit -kt &amp;lt;keytab_file&amp;gt; &amp;lt;principal&amp;gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Connecting Python to Cloudera/Hue/Hive&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;1.Using PyHive it's a Python library specifically designed to work with Hive&lt;/FONT&gt;&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;&lt;SPAN&gt;from pyhive import hive&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Connect to Hive server&lt;BR /&gt;&lt;/SPAN&gt;conn = hive.Connection(&lt;BR /&gt;host='cloudera_host_name',&lt;BR /&gt;port=10000,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Default HiveServer2 port&lt;BR /&gt;username='your_username',&lt;BR /&gt;password='your_password',&lt;BR /&gt;database='default',&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Your database name&lt;BR /&gt;auth='LDAP' # Or 'NONE', 'KERBEROS', 'CUSTOM' depending on your authentication setup&lt;BR /&gt;)&lt;BR /&gt;# Create a cursor&lt;BR /&gt;cursor = conn.cursor()&lt;BR /&gt;# Execute a query&lt;BR /&gt;cursor.execute('SELECT * FROM your_table LIMIT 10')&lt;BR /&gt;# Fetch results&lt;BR /&gt;results = cursor.fetchall()&lt;BR /&gt;print(results)&lt;BR /&gt;# Close connections&lt;BR /&gt;cursor.close()&lt;BR /&gt;conn.close()&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;H2&gt;&lt;FONT size="4"&gt;2. Using the Impala Connection&lt;/FONT&gt;&lt;/H2&gt;&lt;P class="whitespace-pre-wrap break-words"&gt;If your Cloudera cluster uses Impala:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;from impala.dbapi import connect&lt;BR /&gt;conn = connect(&lt;BR /&gt;host='cloudera_host_name',&lt;BR /&gt;port=21050, # Default Impala port&lt;BR /&gt;user='your_username',&lt;BR /&gt;password='your_password',&lt;BR /&gt;database='default' # Your database name&lt;BR /&gt;)&lt;BR /&gt;cursor = conn.cursor()&lt;BR /&gt;cursor.execute('SELECT * FROM your_table LIMIT 10')&lt;BR /&gt;results = cursor.fetchall()&lt;BR /&gt;print(results)&lt;/P&gt;&lt;P&gt;cursor.close()&lt;BR /&gt;conn.close()&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;3.&amp;nbsp;&lt;FONT size="4"&gt;&lt;STRONG&gt;Integration with Hue&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Hue is a web UI for Hadoop, but you can programmatically interact with Hive via its APIs (limited). For direct Python-Hue integration:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Hue’s REST API&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to execute queries:&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;DIV class="md-code-block"&gt;&lt;DIV class="md-code-block-banner-wrap"&gt;&lt;DIV class="md-code-block-banner"&gt;&lt;DIV class="md-code-block-infostring"&gt;&lt;LI-SPOILER&gt;&lt;P&gt;import requests&lt;/P&gt;&lt;P&gt;# Hue API endpoint (replace with your Hue server URL)&lt;BR /&gt;url = "http://&amp;lt;hue_server&amp;gt;:8888/hue/notebook/api/execute/hive"&lt;/P&gt;&lt;P&gt;headers = {"Content-Type": "application/json"}&lt;BR /&gt;data = {&lt;BR /&gt;"script": "SELECT * FROM my_table",&lt;BR /&gt;"dialect": "hive"&lt;BR /&gt;}&lt;BR /&gt;response = requests.post(&lt;BR /&gt;url,&lt;BR /&gt;auth=('&amp;lt;hue_username&amp;gt;', '&amp;lt;hue_password&amp;gt;'),&lt;BR /&gt;headers=headers,&lt;BR /&gt;json=data&lt;BR /&gt;)&lt;BR /&gt;print(response.json())&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4"&gt;Troubleshooting&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;H4&gt;&lt;STRONG&gt;Common Issues:&lt;/STRONG&gt;&lt;/H4&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Connection Refused&lt;/STRONG&gt;:&lt;/LI&gt;&lt;UL&gt;&lt;LI&gt;Verify HiveServer2 is running (netstat -tuln | grep 10000).&lt;/LI&gt;&lt;LI&gt;Check firewall rules.&lt;/LI&gt;&lt;/UL&gt;&lt;LI&gt;&lt;STRONG&gt;Authentication Failures&lt;/STRONG&gt;:&lt;/LI&gt;&lt;UL&gt;&lt;LI&gt;For Kerberos: Ensure&amp;nbsp;kinit&amp;nbsp;succeeded.&lt;/LI&gt;&lt;LI&gt;For LDAP: Validate credentials.&lt;/LI&gt;&lt;/UL&gt;&lt;LI&gt;&lt;STRONG&gt;Thrift Version Mismatch&lt;/STRONG&gt;:&lt;/LI&gt;&lt;UL&gt;&lt;LI&gt;Use Thrift v0.13.0 with Hive 3.x.&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Logs:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Check HiveServer2 logs in Cloudera Manager (/var/log/hive).&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;&lt;FONT size="4"&gt;4. Best Practices&lt;/FONT&gt;&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT size="4"&gt;Use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;connection pooling&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;for high-frequency queries.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;For Kerberos, automate ticket renewal with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;kinit&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;cron jobs.&lt;/LI&gt;&lt;LI&gt;Secure credentials using environment variables or Vault.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Happy hadooping&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 23:27:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-connect-hive-using-Python-for-pytest-databases/m-p/403764#M252186</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2025-03-07T23:27:19Z</dc:date>
    </item>
  </channel>
</rss>

