python - Get only the first 10 columns of a row using happybase -


is possible limited number of columns column family row? lets want fetch first 10 values ['cf1': 'col1'] particular row.

this same question https://github.com/wbolster/happybase/issues/93

the answer is:

i think way scan server side filter. think 1 you're after columncountgetfilter:

columncountgetfilter - takes 1 argument, limit. returns first limit number of columns in table. syntax: columncountgetfilter (‘’) example: columncountgetfilter (4)

source: http://www.cloudera.com/content/cloudera/en/documentation/core/latest/topics/admin_hbase_filtering.html

with happybase (untested):

for row_key, data in table.scan(columns=['cf1'], filter='columncountgetfilter(10)'):     print(row_key, data) 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -