win10 Python3.6连接hive

本文介绍了在Windows 10上使用Python 3.6连接Hive 3.1.0的过程,包括所需Python依赖包的安装,如thrift和impyla等。在连接测试中遇到ThriftParserError和权限问题,通过修改thriftpy解析器文件及Hive配置文件core-site.xml解决了问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

环境

windows 10
python 3.6
hive 3.1.0
hive部署在虚拟机上

Python依赖包

  • thrift
  • thriftpy
  • thrift_sasl
  • pure_sasl
  • impyla
  • bitarray

如果无法使用pip install安装上述包的话,可以在https://www.lfd.uci.edu/~gohlke/pythonlibs/网页下载相应的whl文件,使用python install XXX.whl命令进行安装

开启服务

  1. 开启hadoop集群 start-all.sh
  2. 开启hive server2并在后台运行
    hive --service metastore &
    hive --service hiveserver2 &

连接测试

from impala.dbapi import connect
conn = connect(host='192.168.33.101', port=10000, database='***', user='***', password='', auth_mechanism='NOSASL')
cur = conn.cursor()

auth_mec

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值