2011-06-22 115 views
1

我不太熟悉創建超級列。是column_type=Super正確的方式分配Super1super column創建超級列和密鑰

我不能讓idindex_type: KEYS到:

create column family Super1 with comparator=UTF8Type and 
column_type=Super and key_validation_class=UTF8Type and 
column_metadata = [ 
{column_name: id, validation_class:UTF8Type, index_type: KEYS}, 
{column_name: username, validation_class:UTF8Type}, 
{column_name: email, validation_class:UTF8Type}]; 

請指點。

回答

3

\apache-cassandra-0.8.0\conf\schema-sample.txt發現:

create column family Super1 
with column_type = Super 
and comparator = BytesType 
and subcomparator = BytesType; 

create column family Super2 
with column_type = Super 
and subcomparator = UTF8Type 
and rows_cached = 10000 
and keys_cached = 50 
and comment = 'A column family with supercolumns, whose column and subcolumn names are UTF8 strings'; 

create column family Super3 
with column_type = Super 
and comparator = LongType 
and comment = 'A column family with supercolumns, whose column names are Longs (8 bytes)'; 

三個不同的例子來滿足您的需求...

2

不能創建在supercolumns列索引。