环境
windows 10
python 3.6
hive 3.1.0
hive部署在虚拟机上
Python依赖包
- thrift
- thriftpy
- thrift_sasl
- pure_sasl
- impyla
- bitarray
如果无法使用pip install安装上述包的话,可以在https://www.lfd.uci.edu/~gohlke/pythonlibs/网页下载相应的whl文件,使用python install XXX.whl命令进行安装
开启服务
- 开启hadoop集群 start-all.sh
- 开启hive server2并在后台运行
hive --service metastore &
hive --service hiveserver2 &
连接测试
from impala.dbapi import connect
conn = connect(host='192.168.33.101', port=10000, database='***', user='***', password='', auth_mechanism='NOSASL')
cur = conn.cursor()
auth_mec