There are several parts to the answer.
First, to answer your specific question, you should use sliceQuery to get all the columns in a row. Pass an empty ByteBuffer as start and end values ββto efficiently query all columns:
ByteBuffer empty = ByteBufferUtil.EMPTY_BYTE_BUFFER; sliceQuery.setRange(empty,empty,false,100);
Secondly, you need to make the assumption that the data model is stored in a column family.
If the data model is static (one row per object, one column per attribute), then the column names that you return must be the names of the columns that you want to display. However, if the data is stored dynamically (one object per column, all objects with the same primary key stored in one row) - for example, as in a time series, then you need to understand how the column names (possibly compound) should be interpreted. Another very common application of the dynamic approach is how column families are preserved when defined through CQL.
I must add that there is no way to tell how a family of columns is used to store objects. There is a schema that you can request, but this only talks about how the data should be formatted when it is stored, not how the data (and attribute names) are serialized and deserialized.
Chris gerken
source share