[英]Not understanding the row-key in Python API of Hbase
I have a hbase table ( customers
) in the following form: 我有以下形式的hbase表( customers
):
hbase(main):004:0> scan 'customers'
ROW COLUMN+CELL
4000001 column=customers_data:age, timestamp=1424123059769, value=55
4000001 column=customers_data:firstname, timestamp=1424123059769, value=Kristina
4000001 column=customers_data:lastname, timestamp=1424123059769, value=Chung
4000001 column=customers_data:profession, timestamp=1424123059769, value=Pilot
I tried to extract these data using python API http://happybase.readthedocs.org/en/latest/ : 我试图使用python API http://happybase.readthedocs.org/en/latest/提取这些数据:
import happybase
connection = happybase.Connection('localhost',autoconnect=False)
connection.open()
table = connection.table('customers')
print table.families()
row = table.row('ROW')
print row
It prints table.families()
as: 它将table.families()
打印为:
{'customers_data': {'block_cache_enabled': True,
'bloom_filter_nb_hashes': 0,
'bloom_filter_type': 'ROW',
'bloom_filter_vector_size': 0,
'compression': 'NONE',
'in_memory': False,
'max_versions': 1,
'name': 'customers_data:',
'time_to_live': 2147483647}}
But it prints {}, nothing, in row. 但它会连续输出{},但不输出任何内容。 I am just confused about my understanding row-key value in hbase table. 我只是对我对hbase表中行键值的理解感到困惑。 Do have any suggestion how to get data from hbase table using python API?. 有什么建议如何使用python API从hbase表中获取数据吗? Thanks. 谢谢。
您的行键是“ 4000001”而不是“ ROW”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.