Fiware Cosmos Hive与Python的连接

时间:2016-09-07 11:54:06

标签: fiware fiware-cosmos

我正在尝试使用以下Python代码将Hive查询发送到Fiware Cosmos:

with pyhs2.connect(host='cosmos.lab.fiware.org',port=10000,
                                                authMechanism="PLAIN",
                                                user='xxx',
                                                password="xxx",
                                                database ="xxx" ) as conn: 

                    print ("pyhs --- %s seconds ---" % ( time.time() - start_time))
                    with conn.cursor() as cur:
                            print ("conn ok --- %s seconds ---" % ( time.time() - start_time))
                            cur.execute("add JAR /usr/local/apache-hive-0.13.0-bin/lib/json-serde-1.3.1-SNAPSHOT-jar-with-dependencies.jar")

但是我收到以下错误:

raceback (most recent call last):
File "script2.py", line 40, in <module>
database ="default" ) as conn: 
File "/usr/local/lib/python2.7/site-packages/pyhs2/__init__.py", line 7, in connect
return Connection(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pyhs2/connections.py", line 46, in __init__
transport.open() 
File "/usr/local/lib/python2.7/site-packages/pyhs2/cloudera/thrift_sasl.py", line 74, in open
status, payload = self._recv_sasl_message()
File "/usr/local/lib/python2.7/site-packages/pyhs2/cloudera/thrift_sasl.py", line 92, in _recv_sasl_message
header = self._trans.readAll(5)
File "/usr/local/lib64/python2.7/site-packages/thrift/transport/TTransport.py", line 58, in readAll
chunk = self.read(sz - have)
File "/usr/local/lib64/python2.7/site-packages/thrift/transport/TSocket.py", line 105, in read
buff = self.handle.recv(sz)
socket.error: [Errno 104] Connection reset by peer

两个月前,我可以使用相同的代码连接。任何变化或解决方案?

提前致谢。

0 个答案:

没有答案