无法使用impyla

时间:2017-03-22 15:55:08

标签: python hive impyla

有人可以帮我解决下面在Windows 10上的问题吗?

这是我的python代码:

from impala.dbapi import connect
from contextlib import closing

if __name__ == '__main__':

    with closing(connect(host='host_name_with_hiveserver2',
                 port=10000,
                 database='databasename',
                 user='username',
                 password='password',
                 auth_mechanism='PLAIN')) as conn:
        cursor = conn.cursor()

已安装的Python软件包列表:

  • bitarray == 0.8.1
  • impyla == 0.14.0
  • SASL == 0.2.1
  • 6 == 1.10.0
  • 节俭== 0.9.3
  • 节俭SASL == 0.2.1

版本:

  • 操作系统版本:Microsoft Windows 10(64位)
  • DBMS版本:1.2.1.2.3.6.0-3796 Apache Hive

回溯:

Traceback (most recent call last):
  File "D:/vinokur/projects/python/hive_connect/main.py", line 11, in <module>
    auth_mechanism='PLAIN')) as conn:
  File "D:\vinokur\projects\python\virtual_envs\pip_impyla\lib\site-packages\impala\dbapi.py", line 147, in connect
    auth_mechanism=auth_mechanism)
  File "D:\vinokur\projects\python\virtual_envs\pip_impyla\lib\site-packages\impala\hiveserver2.py", line 758, in connect
    transport.open()
  File "D:\vinokur\projects\python\virtual_envs\pip_impyla\lib\site-packages\thrift_sasl\__init__.py", line 72, in open
    message=("Could not start SASL: %s" % self.sasl.getError()))
thrift.transport.TTransport.TTransportException: Could not start SASL: Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable to find a callback: 2

我能够按照python cannot connect hiveserver2票证的说明在Linux Ubuntu 16.04上成功运行此代码。

提前致谢!

0 个答案:

没有答案