-
环境
redhat7.2、anaconda4.3、python3.5 -
安装python连接hive的依赖包
- yum install gcc python-devel libsmbclient-devel openldap-devel zlib-devel libjpeg-turbo-devel libtiff-devel freetype-devel libwebp-devel lcms2-devel krb5-devel
- pip install sasl
- pip install thrift
- pip install thrift-sasl
- pip install Pyhive
-
进入python环境,建立连接并查询数据
from pyhive import hive conn = hive.Connection(host='hosts', port=10000, database='your databases') import pandas as pd df = pd.read_sql("SELECT * FROM table limit 10", conn)
- 1
- 2
- 3
- 4
python连接hive步骤(不出错版)
最新推荐文章于 2024-08-08 16:39:27 发布