Database Reference
In-Depth Information
Note Updates to the data type of clustering keys and indexes are not allowed.
CQL3 and Thrift Interoperability
Prior to CQL existence, Thrift was the only way to develop an application over Cas-
sandra. CQL3 and Thrift interoperability issues are often discussed within the Cas-
sandra community.
Let's discuss some issues with a simple example:
1.
First, let's create a keyspace and column family using CQL3.
create keyspace cql3usage with replication =
{'class' : 'SimpleStrategy' ,
'replication_factor' : 3};
use cql3usage;
create table user(user_id text PRIMARY KEY,
first_name text, last_name text, emailid
text);
2.
Let's insert one record:
insert into
user(user_id,first_name,last_name,emailid)
values('@mevivs','vivek','mishra',' vivek.mishra@xxx.com ' );
3.
Now, connect with Cassandra-cli (the Thrift way) and update the user
column family to create indexes over last_name and
first_name :
update column family user with
key_validation_class='UTF8Type' and
column_metadata=[{column_name:last_name,
validation_class:'UTF8Type',
index_type:KEYS},{column_name:first_name,
validation_class:'UTF8Type',
index_type:KEYS}];
Search WWH ::




Custom Search