Query Data Using HappyBase

This section demonstrates how to use the HappyBase Python library to access data from HBase.

  1. Launch a Python 3 session and use the workbench command prompt to install the happybase package.
    !pip3 install happybase
  2. 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)