incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DuyHai Doan <doanduy...@gmail.com>
Subject Re: Creating a CQL3 storage layout with row key, column key and column value
Date Wed, 23 Apr 2014 15:18:47 GMT
"And now, when I create an index on column_value. Will the column_value
still be stored with the column_key or will Cassandra create an extra
column?"

 Cassandra will create a column family whose name is "index_name" to index
the column_value for you.

 You can't have access to this column family though...




On Wed, Apr 23, 2014 at 5:02 PM, Sebastian Schmidt <isibboi@gmail.com>wrote:

>  Yes I mean a secondary index.
>
> For example:
>
> CREATE INDEX index_name ON table_name(column_value);
>
> Am 23.04.2014 17:01, schrieb DuyHai Doan:
>
> What do you mean by "index on column_value" ? Do you mean secondary index ?
>
>
> On Wed, Apr 23, 2014 at 4:52 PM, Sebastian Schmidt <isibboi@gmail.com>wrote:
>
>>  And now, when I create an index on column_value. Will the column_value
>> still be stored with the column_key or will Cassandra create an extra
>> column?
>>
>> Am 23.04.2014 16:47, schrieb DuyHai Doan:
>>
>> The schema you just showed allows, for one row key (partition key), to
>> have several distinct pairs of  column_key/column_value. And that's exactly
>> what you want ...
>>
>>
>>
>>
>> On Wed, Apr 23, 2014 at 4:44 PM, Sebastian Schmidt <isibboi@gmail.com>wrote:
>>
>>> Hi,
>>>
>>> I want to create a storage layout with CQL3 like this:
>>>
>>> row_key should be my row key
>>> column_key should by my column key
>>> column_value should be the value saved for the column key
>>>
>>> How can I achieve this?
>>>
>>> I figured that doing this:
>>>
>>> CREATE TABLE table_name (row_key BLOB, column_key BLOB, column_value
>>> BLOB, PRIMARY KEY (row_key, column_key));
>>>
>>> would make column value unique for each row key.
>>>
>>> But I want to store multiple key/value pairs per row. How can I do that
>>> with CQL3?
>>>
>>> Kind regards,
>>> Sebastian
>>>
>>
>>
>>
>
>

Mime
View raw message