我正在尝试从python连接到impala,并使用Impyla模块来实现此目的。以下是用于连接的代码片段。
connect(host='<impala_host>', port=21050)当我尝试执行任何查询时,这将失败,并出现Authorization异常。确切的例外是,
impala.error.HiveServer2Error: AuthorizationException: User '<user>' does not have privileges to execute 'SELECT' on: <table>如何为connect方法提供用户名和密码?
发布于 2016-01-22 09:18:02
从代码中可以看出,默认情况下,user和password参数设置为None。您应该能够使用下面的内容自己设置它们:
connect(host='my.impala.host', port=21050, user='myuser', password='mypassword')您可以在这里查看文档https://github.com/cloudera/impyla/blob/master/impala/dbapi.py。
发布于 2019-04-13 00:12:54
可以在游标参数中定义用户名,例如
conn = connect(host='myhost');
cursor = conn.cursor(user='myuser')
cursor.execute('select user();')发布于 2019-02-26 18:05:28
我也有同样的问题。通过添加use_ssl解决了这个问题:
connect(host='my.impala.host', port=21050, user='myuser', password='mypassword', use_ssl=True)https://stackoverflow.com/questions/32562056
复制相似问题