99999久久久久久亚洲,欧美人与禽猛交狂配,高清日韩av在线影院,一个人在线高清免费观看,啦啦啦在线视频免费观看www

熱線電話:13121318867

登錄
2021-04-07 閱讀量: 518
如何使用Python連接hive

安裝依賴

pip install sasl

pip install thrift

pip install thrift-sasl

pip install PyHive

腳本示例

from pyhive import hive


HOST="127.0.0.1"

PORT=10000

USERNAME="hadoop"

DATABASE="default"


conn=hive.Connection(host=HOST, port=PORT, username=USERNAME,database=DATABASE)

cursor = conn.cursor()

#cursor.execute("INSERT INTO TABLE test_out(name,count,time) SELECT name,count(1),to_date(time) FROM test GROUP BY name,to_date(time)")

cursor.execute("SELECT * FROM test")

for result in cursor.fetchall():

print(result[2])


200.0000
0
關(guān)注作者
收藏
評(píng)論(0)

發(fā)表評(píng)論

暫無數(shù)據(jù)
推薦帖子