impala的python客户端impyla

  • 依赖条件:

gcc make git setuptools

  • 安装:
git clone https://github.com/cloudera/impyla.git  
cd impyla  
python setup.py install  
  • 使用
>>> from impala.dbapi import connect
>>> conn = connect(host='hd2.mc.com', port=21050)
>>> cursor = conn.cursor()
>>> cursor.execute('SELECT * FROM online LIMIT 10')
>>> print cursor.description
>>> results = cursor.fetchall()
>>> print results[0]