Hi,

Just wanted to share an issue I had to overcome after upgrading to Cassandra 0.8
from 0.7. My app became unable to read a BytesType sub-column.

It turned out that ByteBuffer returned as a value of a sub-column can not be
assumed to contain only the bytes of the sub-column. As a result one has to use
relative access methods on the ByteBuffer. 

In other words the array below contains column value not at position 0 but at
position value.position(). 

for (HColumn<String,ByteBuffer> column : superColumn.getColumns()) {
        ByteBuffer value = column.getValue();
        byte[] array = value.array();
}

Oleg




Reply via email to