![](/img/trans.png)
[英]How single partition batch in Cassandra function for multiple column update?
[英]Update single column in cassandra
我有以下cassandra專欄系列:
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}
];
我想更新給定“電子郵件”的“全名”,但我不知道行鍵只有“電子郵件”。 我該如何使用Hector Thrift API?
我知道我將不得不插入新列,因為cassandra中沒有更新之類的東西。 在為同一行插入新列之前是否需要獲取行鍵?
使用cassandra-cli或hector插入是最基本的操作。 可能是您需要刷卡桑德拉回購品閱讀此內容 。
嘗試使用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']='XYZ@GMAIL.COM';
檢索數據,
list cfn;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.