How to retrieve data from cassandra

42 views
Skip to first unread message

Ashu Gupta

unread,
May 16, 2013, 2:11:34 AM5/16/13
to hector...@googlegroups.com
I am working on cassandra 1.2.3 and using hector 1.1-3 When I fetch columns using SliceQuery, it returns me all the columns with the same datatype. Is there any way that QueryResult have object as the datatype of column values? If I use bytebuffer , So if I want to return multiple columns containing different data types(as a wrapper method over Hector), what data type do I return from my wrapper method?? I obviously won't know which column will have which data type & I can't return ByteBuffer as a generic column value type. Can anyone help me out with this?

Nate McCall

unread,
May 16, 2013, 4:30:44 PM5/16/13
to hector...@googlegroups.com
You will need to store a marker of some sort denoting the type either
on the column name of the column value. Using composites for this
would be a good idea. DynamicComposite would effectively give you this
for free, but they are slightly more complicated.
> --
> You received this message because you are subscribed to the Google Groups
> "hector-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to hector-users...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Ashu Gupta

unread,
May 20, 2013, 2:00:42 AM5/20/13
to hector...@googlegroups.com
Thanx Nate
Is this the only way? because I have already ported my sql database to cassandra. Do I need to run the complete procedure again after storing that extra marker to denote the type? And suppose I have done that ,now how should I check that extra byte while retrieving rows?
Reply all
Reply to author
Forward
0 new messages