incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aaron morton <aa...@thelastpickle.com>
Subject Re: how to get column type?
Date Fri, 19 Oct 2012 01:24:35 GMT
It depends if C* knows about the column. 

You can check this by looking at the schema in cassandra-cli, see the online help for show
schema. 

AFAIK most higher level libraries will get the data type info via the API. They use this to
determine the wire format for serialisation. Crack open the client for in your chosen language
and take a look if you need programatic access. 

Cheers

-----------------
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 19/10/2012, at 1:40 AM, "Hiller, Dean" <Dean.Hiller@nrel.gov> wrote:

> This is specifically why Cassandra and even PlayOrm are going the
> direction of "partial schemas".  Everything in cassandra in raw form is
> just bytes.  If you don't tell it the types, it doesn't know how to
> translate it.  PlayOrm and other ORM layers are the same way though in
> these noSQL ORMs you typically have a schema where it is sort of like this
> 
> If(colName.equals("name"))
>   return String.class;
> else if(colName.equals("age"))
>   Return Integer.class;
> 
> So column values are typed such that a command line tool like PlayOrm's
> command line tool can query and know how to translate the results.  Any
> parts of the schema that are not known are just returned in hex.
> 
> So schemaless is cool, but sometimes it is a big pain as well.
> 
> Dean
> 
> On 10/18/12 6:24 AM, "Hagos, A.S." <A.S.Hagos@tue.nl> wrote:
> 
>> Hi all,
>> I am wondering if there is a way to know the column type of an already
>> stored value in  Cassandra.
>> My specific case is to get a column value of a known column name but not
>> type.
>> 
>> greetings 
>> Ambes
> 


Mime
View raw message