我正在尝试在Amazon EMR上使用Python在Hive上运行查询。 这是我的联络人
connect_kwargs = dict(
host='localhost',
port=10000,
auth_mechanism='PLAIN',
user='hadoop',
kerberos_service_name='hive',
use_ssl = True,
database='default'
)
我创建一个连接和一个游标,然后使用游标执行查询
conn = impala.dbapi.connect(**connect_kwargs)
cursor = conn.cursor()
我遇到此错误:
Script execution started at : 1577333837.6
No handlers could be found for logger "thrift.transport.sslcompat"
Traceback (most recent call last):
File "getDailyCount.py", line 126, in <module>
main()
File "getDailyCount.py", line 71, in main
conn = impala.dbapi.connect(**connect_kwargs)
File "/usr/local/lib/python2.7/site-packages/impala/dbapi.py", line 150, in connect
http_path=http_path)
File "/usr/local/lib/python2.7/site-packages/impala/hiveserver2.py", line 825, in connect
transport.open()
File "/usr/local/lib/python2.7/site-packages/thrift_sasl/__init__.py", line 68, in open
self._trans.open()
File "/usr/local/lib64/python2.7/site-packages/thrift/transport/TSSLSocket.py", line 301, in open
super(TSSLSocket, self).open()
File "/usr/local/lib64/python2.7/site-packages/thrift/transport/TSocket.py", line 122, 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), ('127.0.0.1', 10000)]
我的计算机上安装了以下软件包:
sudo pip install impyla
sudo yum install cyrus-sasl-devel
sudo pip install thrift_sasl