安装加载包
pip install sasl
pip install thrift
pip install thrift-sasl
pip install pyhive
调用包
import time
time1=time.time()
import pandas as pd
from pyhive import hive
cursor=hive.connect(host=‘192.168.14.101’,port=‘10000’,username=‘hive’)
con.cursor()
sql="""
此处放sql脚本
cursor.execute(sql)
data=pd.DataFrame(cursor.fetchall())
print(data.head())
time2 = time.time()
print(‘总共耗时:’ + str(time2 - time1) + ‘s’)
cur.execute(“select * from hive01.data02”)
cur.fetchone()