revelc / pyaccumulo

Python Client Library for Apache Accumulo
Apache License 2.0
26 stars 23 forks source link

Cannot write integers as values #10

Closed arusahni closed 11 years ago

arusahni commented 11 years ago

Hi, I'm currently trying to write an int as a value, but I cannot as it appears that pyaccumulo is assuming that all values are strings:

https://github.com/accumulo/pyaccumulo/blob/master/pyaccumulo/proxy/ttypes.py#L412

Is this intentional?

jatrost commented 11 years ago

This is correct. The code you linked to is the thrift auto generated code.

Accumulo values are byte arrays. In order to store ints/floats you have to chose how to serialize them. For small numbers it makes sense to serialize as strings (when most numbers are less than 10,000). For larger numbers it make sense to serialize as 32 bit int or 64 bit float.

arusahni commented 11 years ago

Thanks!