在Cassandra Cli设置超级列系列

Hen*_*nry 3 command-line-interface cassandra super-columns

我正在使用Cassandra 0.8.0.

我无法弄清楚如何使用Cassandra-Cli为当前存在的SuperColumn添加值.例如:我已将以下内容添加到我的密钥空间

create column family authors
with comparator = UTF8Type and subcomparator = UTF8Type
and default_validation_class = UTF8Type
and column_metadata = [{
    column_name: tags, validation_class: UTF8Type},
    {column_name: url, validation_class:UTF8Type},
    {column_name: title, validation_class: UTF8Type},
    {column_name: publisher, validation_class: UTF8Type},
    {column_name: email, validation_class: UTF8Type}];
Run Code Online (Sandbox Code Playgroud)

我尝试在这个超级列中添加一行:(输入)[default@testspace] set authors[1]['1']['url'] = 'www.henry.com';

(输出)[default@testspace] null 这是一个错误^

我也试过这个:

[default@testspace] set authors['henry']['url']['1'] = 'www.henry.com';
Run Code Online (Sandbox Code Playgroud)

得到:

org.apache.cassandra.db.marshal.MarshalException: cannot parse 'henry' as hex bytes
Run Code Online (Sandbox Code Playgroud)

在Cassandra-Cli中操作SuperColumns的正确语法是什么?您能否提供一个使用cassandra-cli中的超级列来设置/获取值的示例?

谢谢

dre*_*obb 6

你需要添加

column_type = 'Super' and key_validation_class = UTF8Type
Run Code Online (Sandbox Code Playgroud)

到你的列族定义.