This section demonstrates how to use the HappyBase
Python library to
access data from HBase.
-
Launch a Python 3 session and use the workbench command prompt to install the
happybase
package.
-
Use
happybase
to connect to the employees
table
created in the previous step.
Python
import happybase
connection = happybase.Connection(host='<hbase_thrift_server_hostname>', port=9090, autoconnect=True)
table = connection.table('employees')
rows = table.rows(['1','2','3'])
for key, data in rows:
print(key, data)