24412-Python链接LDAP(Kerbores)认证的Impala
必须安装pyImpala才行
pip install impyla
Python3.x 链接LDAP(Kerbores)认证的Impala代码
from impala.dbapi import connect
impala_host = "172.10.194.101"
impala_port = "25004"
impala_user = 'huabingood_test'
impala_pwd = '666666'
# 创建pyimpala链接
def getDataFromImpala(sql: str):
print("当前向impala查询的是:\n" + sql)
conne = connect(host=impala_host, port=impala_port, auth_mechanism='LDAP', user=impala_user, password=impala_pwd,
timeout=600, retries=6)
cur = conne.cursor()
cur.execute(sql)
res = cur.fetchall()
return res
if __name__ == "__main__":
sql = "show tables in sdata;"
res = getDataFromImpala(sql)
print(res)
标签:__,24412,Python,res,Kerbores,Impala,sql,LDAP,impala From: https://www.cnblogs.com/yanghuabin/p/18342315/24412python-link-ldap-kerbores-certified-imp