我曾经使用
impyla
0.9.0 连接到 impala。但当我将impyla
升级到0.12.0后,我被告知Specifying the protocol argument is no longer necessary because impyla only supports HiveServer2.
。所以我从配置文件中删除了protocol
。然后当我尝试连接 Impala 时,我不断收到如下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "data_pipelines/tasks/impala_task.py", line 96, in run
cursor = self.get_cursor()
File "data_pipelines/tasks/impala_task.py", line 65, in get_cursor
timeout=_load_impala_timeout()).cursor()
File "/Library/Python/2.7/site-packages/impala/hiveserver2.py", line 88, in cursor
session = self.service.open_session(user, configuration)
File "/Library/Python/2.7/site-packages/impala/hiveserver2.py", line 798, in open_session
resp = self._rpc('OpenSession', req)
File "/Library/Python/2.7/site-packages/impala/hiveserver2.py", line 724, in _rpc
response = self._execute(func_name, request)
File "/Library/Python/2.7/site-packages/impala/hiveserver2.py", line 741, in _execute
return func(request)
File "/Library/Python/2.7/site-packages/impala/_thrift_gen/TCLIService/TCLIService.py", line 175, in OpenSession
return self.recv_OpenSession()
File "/Library/Python/2.7/site-packages/impala/_thrift_gen/TCLIService/TCLIService.py", line 191, in recv_OpenSession
raise x
thrift.Thrift.TApplicationException: Invalid method name: 'OpenSession'
有人遇到过同样的问题吗?有谁知道如何修复它以及如何使用 Impyla 0.12.0 连接到 Impala?预先感谢!
通过更改端口解决,根据Impyla Github问题