- 安装thrift_sasl(hive要开启thrift server)
注意pypi上的包有bug,要从github源码包安装
git clone https://github.com/cloudera/thrift_sasl.git
cd thrift_sasl
python setup.py install
- 安装pyhive
pip install pyhive
- 使用
import pandas as pd
from sqlalchemy.engine import create_engine
eg = create_engine('hive://localhost:10000/default')
pd.read_sql('show tables', eg)