python jaydebeapi connected to phoenix

Use pip install JayDeBeApi, specific examples are as follows:

import jaydebeapi
conn = jaydebeapi.connect('org.apache.phoenix.jdbc.PhoenixDriver', \
'jdbc:phoenix:my_zk_server:2181:test', ['', ''], \
'/workspace/service/phoenix-client/phoenix-client.jar')
curs = conn.cursor()
curs.execute('select * from your_table limit 1')
curs.fetchall()

Note: test for a hbase of a namespace.

Guess you like

Origin www.cnblogs.com/lizheng19822003/p/11133055.html