hbase-python
hbase-python copied to clipboard
hbase.exceptions.RequestError: Failed to get region for default namespace
I got hbase.exceptions.RequestError: Failed to get region exception when tried to do get
operation from the table located in the default namespace.
Here is my code:
with hbase.ConnectionPool(zk).connect() as conn:
table = conn['default']['table_name']
row = table.get('row1')
print(row)
exit()
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1664, in
I did further investigation and find the reason.
When this function is called https://github.com/3601314/hbase-python/blob/4230091664730908f8e90a057b310f10ffb73ad1/hbase/client/region.py#L247
We have meta_key = 'default:table_name,row1,:'
Change that to the meta_key = 'table_name,row1,:'
fixes the issue.
So HBase API does expect only table_name
for the default namespace and default:table_name
is not valid.
I would suggest fixing that. I can do that myself and open PR if you agree to change the way the meta_key
is formed.