python如何通过jdbc来连接impala?

2021-09-15 14:15发布

python如何通过jdbc来连接impala?需要装什么包么?

python如何通过jdbc来连接impala?需要装什么包么?

14条回答
aijingda
2021-09-18 15:37

打开python安装路径下的thriftpy文件夹,找到parse文件,修改第488行的if url_scheme==''

为 if len(url_scheme)<=1 即可

保存后重新启动你的python shell或者jupyter notebook

大工告成!!

from impala.dbapi import connect
from impala.util import as_pandas
import pandas as pd
import numpy as np
#连接数据
conn=connect(host='地址啊喂',port=端口号啊喂)
cur=conn.cursor()
cur.execute('show tables')
print(cur.fetchall())

#查看输出结果吧,有表名就都连上啦~


一周热门 更多>