使用PyHive操作Hive

废话

搜了一下,看到了StackOverFlow的回答,试了一下前两个方案,感觉第二个更简洁,这里记录一下,更详细的见参考。

安装依赖
pip install sasl
pip install thrift
pip install thrift-sasl
pip install PyHive
操作
from pyhive import hive
conn = hive.Connection(host='xxxx', port=10000, username='xxx', database='default')
cursor.execute('select * from url_log limit 10')
for result in cursor.fetchall():
    print result
参考

相关文章:

  • 2021-10-30
  • 2022-12-23
  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
  • 2022-02-04
猜你喜欢
  • 2022-12-23
  • 2021-07-21
  • 2021-07-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案