When you say

>  comparator=BytesType

You are telling cassandra that the column names in the CF's are just bytes. But 
when you create the column meta data you are specifying the column names as 
strings. 

use UTF8Type as the comparator. 

Cheers

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

On 22/05/2012, at 11:09 PM, Roshan Dawrani wrote:

> Hi,
> 
> I use Cassandra 0.8.5 and am suddenly noticing some strange behavior. I run a 
> "create column family" command with some column meta-data and it runs fine, 
> but when I do "describe keyspace", it shows me different column names for 
> those index columns.
> 
> a) Here is what I run: 
> "create column family UserTemplate with comparator=BytesType and 
> column_metadata=[{column_name: userid, validation_class: UTF8Type, 
> index_type: KEYS, index_name: TemplateUserIdIdx}, {column_name: type, 
> validation_class: UTF8Type, index_type: KEYS, index_name: TemplateTypeIdx}];"
> 
> b) This is what "describe keyspace" shows:
>     ColumnFamily: UserTemplate
>       Key Validation Class: org.apache.cassandra.db.marshal.BytesType
>       ...
>       ...
>       Built indexes: [UserTemplate.TemplateTypeIdx, 
> UserTemplate.TemplateUserIdIdx]
>       Column Metadata:
>         Column Name: ffffff
>           Validation Class: org.apache.cassandra.db.marshal.UTF8Type
>           Index Name: TemplateUserIdIdx
>           Index Type: KEYS
>         Column Name: 0dfffaff
>           Validation Class: org.apache.cassandra.db.marshal.UTF8Type
>           Index Name: TemplateTypeIdx
>           Index Type: KEYS
> 
> Does anyone see why this must be happening? I have created many such column 
> families before and never run into this issue.
> 
> -- 
> Roshan
> http://roshandawrani.wordpress.com/
> 

Reply via email to