Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Did table.cells supports variable columnnames in one program #41

Closed
Narenthirasamy opened this issue Sep 3, 2013 · 1 comment
Closed

Comments

@Narenthirasamy
Copy link

Hi wbolster,
I want to see the versions of data in hbase, I'm using table.cells() in here i can give row_key as variable and for that row key i have many column names i don't know what are it,by using the same can i get column name iteratively..
I have only one columnfamily that is cf1
Here i pasted my code,can u help me..

Thank you

!/usr/bin/env python

from happybase import Connection
from time import time
TABLE_NAME = 'test'
connect = Connection('localhost')
table_conn = connect.table(TABLE_NAME)
def versioning(rowkey):

versions = table_conn.cells(rowkey,columname,versions = 100000)
init = 0
for column,value in versions.items():
    print "Data : %s" % value
    init = init + 1
    #print init

print "Data : %s" % value
print "Columnname : %s " % column
print "Data count : %s" % init

if name == "main":

"""
   For command line test

"""
rowkey = 'string'
column = 'cf1'
start = time()
count = versioning(rowkey)
print count
end  = time()
print end - start

thanks alot

@wbolster
Copy link
Member

wbolster commented Sep 7, 2013

Unfortunately the Thrift API does not support retrieving complete rows (or scanning over a table) while return multiple versions for a single cell. Is that what you mean? The table.cell() API is the only way to get multiple versions for a single cell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants