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

fetch_all_rows() returns None on default arguments. #13

Open
hanwentao opened this issue Sep 4, 2014 · 7 comments
Open

fetch_all_rows() returns None on default arguments. #13

hanwentao opened this issue Sep 4, 2014 · 7 comments

Comments

@hanwentao
Copy link

It works with argument scanner_config={}. The default value '' can't be parsed by Java side, and causes an HTTP Error 500.

@barseghyanartur
Copy link
Owner

Hey,

Thanks for reporting this. I'll check the issue and make a fix soon.

Best regards,

@barseghyanartur
Copy link
Owner

@hanwentao:

Hey, the following code works for me:

from starbase import Connection
c = Connection()
t = c.table('messages')
[row for row in t.fetch_all_rows()]

Could you provide some more information on the issue?

@hanwentao
Copy link
Author

I think the problem lies on the server side. The version of HBase I used is 0.96.1, and it can't parse "" as a JSON object.

@barseghyanartur
Copy link
Owner

@hanwentao

Confirmed on HBase 0.98.1-cdh5.1.0 (Cloudera).

{u'JVM': u'Oracle Corporation 1.7.0_55-24.55-b03',
u'Jersey': u'1.8',
u'OS': u'Linux 2.6.32-431.23.3.el6.x86_64 amd64',
u'REST': u'0.0.2',
u'Server': u'jetty/6.1.26.cloudera.2'}

@jking777
Copy link

Also happened to me with HBase 0.98.4. With default parameters I get an error, with a no-op scanner_config parameter it works.

@JunLuo
Copy link

JunLuo commented Sep 5, 2016

I track the source and find that:
if scanner_config == "", the request data is ""
but the Content-type of starbase is application/json, so the http request will pass data "" to hbase rest server, the error occurs.
if scanner_config == {}, the request data is "{}" and it can work

ps: if scanner_config == '' , it also can work because python will convert content type to xml/text, and you also can define the batch size of scanner.

@barseghyanartur
Copy link
Owner

@JunLuo:

Thanks for tracking this down. I'll fix it ASAP.

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

4 participants