from pyhive import hive
import pandas as pd
conn = hive.Connection(host="00.000.00.00",
port=10000,
auth="XXXX",
database="default",
username="user_name",
password="123456")
sql='''
select *
from table
'''
df = pd.read_sql(sql,con=conn)
2. 连presto
import pandas as pd
import numpy as np
from datetime import date
import sys
from sklearn import preprocessing
from dccdb import Presto
_presto = Presto()
data =_presto.prestoSelect(sql='''
select *
from table
limit 100
''',
username ='user_name',
withcolumns=0)
y=list(data)
df=pd.DataFrame(y[1])len(df)