我不太熟悉创建超级列。 column_type=Super
是将Super1
指定为super column
的正确方法吗?
我无法将id
视为index_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}];
请指教。
答案 0 :(得分: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)';
三个不同的例子以满足您的需求......
答案 1 :(得分:2)
您无法在超级列上创建列索引。