TException: A long is exactly 8 bytes #37

beiercai opened this Issue May 26, 2010 · 3 comments


None yet

2 participants


Maybe I'm missing something here, but I can't seem to save a column defined as LongType

              <ColumnFamily Name="MyTest"
                CompareSubcolumnsWith="BytesType" />

Here is the PHP code:

if (!PandraCore::auto('')) {

//super column name is a timestamp, and compare with longtype, so column names are sorted by time
$superName = time();
$keyId = '101';
$cfName = 'testCF';
$sc = new PandraSuperColumn($superName, $keyId, $cfName);

I got this error back:

[0] => TException: A long is exactly 8 bytes

Does Pandra convert an integer to long type Thrift expects?


No it's not implemented yet, but depending on your architecture it can be set via pack() ...

eg: 32-bit big-endian :
$time = pack("NN", time(), 0);

and then to extract, the converse 32-bit unpack...
$timeUnpacked = array_pop(unpack('N', $time));


Sorry there's not a patch yet for this.


Thanks, that worked!

Any plan to support it in the future? it's just a bit strange to deal with byte stream on a high layer.


There will be a solution in place for the 0.3 release, it's currently only stubbed in the column container class

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment