我正在尝试通过Python脚本建立到impala数据库的连接,使用keytab而不是普通的用户/密码组合,但无法在网上找到任何教程,我目前使用的代码是:
conn = connect(host=impala_host, port=impala_port, use_ssl=True, auth_mechanism="PLAIN", user=username, password=pwd, database=impala_db)
cursor = conn.cursor() 但是,我想使用keytab而不是我的密码进行连接。
发布于 2019-03-28 17:04:21
看起来您正在尝试使用该库:https://github.com/cloudera/impyla
请查看README.md中的Usage部分:
from impala.dbapi import connect
conn = connect(host='my.host.com', port=21050)
cursor = conn.cursor()
cursor.execute('SELECT * FROM mytable LIMIT 100')
print cursor.description # prints the result set's schema
results = cursor.fetchall()
...
...https://stackoverflow.com/questions/55375352
复制相似问题