2013-05-02 72 views
0

我有以下卡桑德拉列族:更新单个列在卡桑德拉

create column family cfn 
with comparator = UTF8Type 
and key_validation_class = UUIDType 
and column_metadata =[ 
     {column_name:email, validation_class: UTF8Type,index_type: KEYS} 
     {column_name:full_name, validation_class: UTF8Type} 
]; 

我想更新给予“邮件”的“FULL_NAME”但我不知道该行关键我只有“电子邮件”。我如何使用hector节俭api来做到这一点?

我知道我将不得不插入一个新的列,因为在cassandra中没有更新类型的东西。在为同一行插入新列之前是否需要获取行键?

回答

0

插入使用cassandra-cli或hector是最基本的东西。可能是你需要刷你的卡桑德拉回购Read This

试试这个使用CLI

SET cfn[RowKey]['full_name']='XYZ'; 
/* 
*Remember you have mentioned your key as UUID Type. So while providing a Rowkey it should 
*be in UUID type only. e.g 8aff3820-1e55-11b2-a248-41825ac3edd8 
*/ 
SET cfn[RowKey]['email']='[email protected]'; 

检索数据,

list cfn; 
+0

我已经提到,我想用威吓 – manish 2013-05-03 15:26:31

+0

你可以分享**从cqlsh外壳描述#KeyspaceName **输出更新? – abhi 2013-05-03 17:58:02

+0

仅供参考,当您从cli创建一个columnfamily时,默认情况下,rowkey名称是** key **,类型为** uuid ** – abhi 2013-05-03 18:04:50