Mit Pyhive kann keine Verbindung zum Hive hergestellt werdenPython

Python-Programme
Anonymous
 Mit Pyhive kann keine Verbindung zum Hive hergestellt werden

Post by Anonymous »

Ich erhalte die Fehlermeldung „EOFError()“, während ich eine Verbindung herstelle, um hiveserver2 zu entfernen. Meine Pyhive-Version ist 0.6.1

hiveserver2 verwendet http als Transportmodus

Dies ist die Ausnahme

Code: Select all

ile "", line 1, in 
File "/usr/local/lib/python2.7/dist-packages/pyhive/hive.py", line 94, in connect
return Connection(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pyhive/hive.py", line 198, in __init__
response = self._client.OpenSession(open_session_req)
File "/usr/local/lib/python2.7/dist-packages/TCLIService/TCLIService.py", line 187, in OpenSession
return self.recv_OpenSession()
File "/usr/local/lib/python2.7/dist-packages/TCLIService/TCLIService.py", line 199, in recv_OpenSession
(fname, mtype, rseqid) = iprot.readMessageBegin()
File "/usr/local/lib/python2.7/dist-packages/thrift/protocol/TBinaryProtocol.py", line 148, in readMessageBegin
name = self.trans.readAll(sz)
File "/usr/local/lib/python2.7/dist-packages/thrift/transport/TTransport.py", line 65, in readAll
raise EOFError()
Hier ist auch der Code, den ich zum Herstellen einer Verbindung zum Entfernen von Hive verwende

Code: Select all

from pyhive import hive
from thrift.transport import THttpClient
host = 'xxx'
scheme = 'http'
path = '/cliservice'
port = ':' + str(10001)
http_uri = "{}://{}{}{}".format(scheme, host, port, path)
transport = THttpClient.THttpClient(http_uri)

username = 'xxx'
password = ''
if username or password:
auth = base64.b64encode(username + ':' + password)
transport.setCustomHeaders({'Authorization': 'Basic ' + auth})
connection = hive.connect(thrift_transport=transport)

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post