python利用pyhive 连接hive
生活随笔
收集整理的這篇文章主要介紹了
python利用pyhive 连接hive
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1.下載需求包
? pip install sasl
? pip install thrift
? pip install thrift-sasl
? pip install PyHive
2.連接hive 注意端口默認(rèn)為10000
from pyhive import hive conn = hive.Connection(host='192.168.100.100', port=10000, username='root', database='default') cursor = conn.cursor() cursor.execute('show tables')for result in cursor.fetchall():print(result)總結(jié)
以上是生活随笔為你收集整理的python利用pyhive 连接hive的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: tar打包命令(linux)
- 下一篇: pcb文件的作用