I have installed all the required libraries (thrift, thrift-sasl, PyHive, sasl) and tried to make connection with hive using PyHive. Also using Python3 Expecting to have a successful connection to hive using PyHive library. I am doing this entire work on Azure virtual machine
I have tried with port 10000 and I am getting this error
Traceback (most recent call last): File "pyhive_****.py", line 6, in conn = connect(host='localhost', port=10000, user='hive', auth_mechanism='NOSASL')
File "/home/azureuser/.local/lib/python3.8/site-packages/impala/dbapi.py", line 194, in connect service = hs2.connect(host=host, port=port,
File "/home/azureuser/.local/lib/python3.8/site-packages/impala/hiveserver2.py", line 865, in connect transport.open()
File "/home/azureuser/.local/lib/python3.8/site-packages/thrift/transport/TTransport.py", line 155, in open return self.__trans.open()
File "/home/azureuser/.local/lib/python3.8/site-packages/thrift/transport/TSocket.py", line 146, in open raise TTransportException(type=TTransportException.NOT_OPEN, message=msg)
thrift.transport.TTransport.TTransportException: Could not connect to any of [('127.0.0.1', 10000)
I have changed the port to a working port and then it is throwing this error:
Traceback (most recent call last): File "pyhive***.py", line 8, in cursor = conn.cursor()
File "/home/azureuser/.local/lib/python3.8/site-packages/impala/hiveserver2.py", line 129, in cursor session = self.service.open_session(user, configuration)
File "/home/azureuser/.local/lib/python3.8/site-packages/impala/hiveserver2.py", line 1190, in open_session resp = self._rpc('OpenSession', req, True)
File "/home/azureuser/.local/lib/python3.8/site-packages/impala/hiveserver2.py", line 1083, in _rpc response = self._execute(func_name, request, retry_on_http_error)
File "/home/azureuser/.local/lib/python3.8/site-packages/impala/hiveserver2.py", line 1144, in _execute raise HiveServer2Error('Failed after retrying {0} times' impala.error.HiveServer2Error: Failed after retrying 3 times