python3连接impala(centos7)

python3使用impala centos7

1、依赖环境部署

    python3 环境部署略
./pip3 install six
./pip3 install bit_array
./pip3 install thriftpy
 yum install gcc-c++ python-d
./pip3 install sasl
./pip3 install thrift_sasl
./pip3 install bitarray
./pip3 install impyla
./pip3 install pandas

2、验证

from impala.dbapi import connect
from impala.util import as_pandas
conn = connect(host='10.10.1.1', port=21050)
cur = conn.cursor()
cur.execute('SHOW TABLES')
cur.execute('select * from test.test limit 1')
data = as_pandas(cur)
print (data)
print (type(data))
posted @ 2019-12-18 19:42  石Stone头  阅读(1167)  评论(0编辑  收藏  举报