cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Lebresne <sylv...@datastax.com>
Subject Re: [1.1] Can't create column
Date Fri, 11 May 2012 06:57:14 GMT
On Sun, May 6, 2012 at 2:19 PM, cyril auburtin <cyril.auburtin@gmail.com> wrote:
> It's the comparator so? because I tried without the single quotes on
> column_name and same error

Yes, it's the comparator, not the single quotes. The column_name in
the column_metada is, as the name imply, a column name. Thus is must
be compatible with the column family comparator. The default
comparator of a column family is BytesType, which interpret it's value
has hex string representing bytes and thus you get the error that
"user" is not a hexadecimal string. So you have to specifiy a
comparator that specifically handle strings, like UTF8Type or
AsciiType.

--
Sylvain

> thanks
>
>
> 2012/5/6 Pierre Chalamet <pierre@chalamet.net>
>>
>> create column family Post with comparator=UTF8Type and
>> colum_metadata=[{column_name : user, validation_class : UTF8Type}] and
>> comment='bla’;
>>
>>
>>
>> - Pierre
>>
>>
>>
>> From: cyril auburtin [mailto:cyril.auburtin@gmail.com]
>> Sent: dimanche 6 mai 2012 13:10
>> To: user@cassandra.apache.org
>> Subject: [1.1] Can't create column
>>
>>
>>
>> [default@ks] create column family Post with column_type = 'Standard' and
>> column_metadata = [{column_name: 'user', validation_class: 'UTF8Type'},
>> {column_name: 'type', validation_class: 'UTF8Type'}] and comment = 'bla';
>>
>> java.lang.RuntimeException:
>> org.apache.cassandra.db.marshal.MarshalException: cannot parse 'user' as hex
>> bytes
>>
>>
>
>

Mime
View raw message