【python 连接hbase】python连接hbase 简单

python是通过thrift去访问操作hbase

1、首先需要先安装happyhbase和thrift

pip install happybase

pip install thrift

2、需要修改源码一个文件parser.py

如果执行的时候报错:
py.parser.exc.ThriftParserError: ThriftPy does not support generating module with path in protocol ‘c’

则将 C:/Python27/Lib/site-packages/thriftpy/parser/parser.py …
if url_scheme == ”:
修改为

if len(url_scheme) <= 1:

再次执行即可。

3、python 操作hbase 用法参考官网

http://happybase.readthedocs.io/en/latest/user.html#retrieving-data

详细介绍都在里面。

猜你喜欢

转载自blog.csdn.net/u013421629/article/details/81333162
今日推荐