Python Forum
Python-Hive connectivity issue
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python-Hive connectivity issue
#1
We have Virtual Private network in which we have Windows Server box, and Hadoop Distribution based on Hortonworks installed on several data nodes on Redhat.

The Python script is installed on Windows machine and we are trying to access Hive tables available on the said Hadoop cluster.
On Hive 10000 port number is open to listen to the external requests.

From Windows box ODBC connectivity is working fine with said port, but below mentioned Python script is failing to execute with errors.

For that we have installed some mandatory packages which are needed for the hive connection as below;
• pyhive
• sasl
• thrift-sasl
• pure-sasl

Please find below code:

from pyhive import hive
from TCLIService.ttypes import TOperationState
import sasl
import thrift
import pandas as pd
import pyhs2

cursor = hive.connect(host='dnanoripaihos01.retailaip.local', auth='KERBEROS', port='10000',kerberos_service_name='hive').cursor()
cursor.execute('SELECT * FROM cancellations LIMIT 50')
print (cursor.fetchall()) 
When we execute this script it gives us below error:

Error:
Traceback (most recent call last): File "C:\Users\rekha.b.gaonkar\Desktop\load_hive_table.py", line 9, in <module> cursor = hive.connect(host='dnanoripaihos01.retailaip.local', auth='KERBEROS', port='10000',kerberos_service_name='hive').cursor() File "<C:\Program Files (x86)\Python37-32\lib\site-packages\pyhive\hive.py>", line 94, in connect return Connection(*args, **kwargs) File "<C:\Program Files (x86)\Python37-32\lib\site-packages\pyhive\hive.py>", line 192, in __init__ self._transport.open() File "<C:\Program Files (x86)\Python37-32\lib\site-packages\thrift_sasl\__init__.py>", line 79, in open message=("Could not start SASL: %s" % self.sasl.getError())) 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'
Please help us to resolve this issue.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Jira Connectivity Shyam 0 171 Mar-19-2024, 05:43 PM
Last Post: Shyam
  Mysql-Python Connectivity Error aryamanurs 2 3,374 Apr-29-2020, 02:21 PM
Last Post: aryamanurs
  Error in Database connectivity with python3.7 srm 8 4,413 May-13-2019, 07:28 AM
Last Post: srm
  Why is basic Twitter Connectivity So Difficult? Not sure what I'm doing wrong. Oliver 0 1,856 Mar-10-2018, 12:38 PM
Last Post: Oliver
  Checking connectivity for sockets in Python pikkip 1 3,004 Apr-27-2017, 05:02 PM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020