我想在我的数据库中使用 cassandra -cli 的以下结构
例如,我有一个人的地址,地址包含邮政编码、门牌号等示意图,如下所示:
name: "address",
value: {
city: {name: "city", value: "San Francisco"},
street: {name: "street", value: "555 Union Street"},
zip: {name: "zipcode", value: "94105"},
}
我知道如何创建超列和普通列。但我想使用 column_metadata 来指定超列中的列的外观。所以最终会是这样的:
Create column family person
with comparator = UTF8Type
and key_validation_class=UTF8Type
and default_validation_class = UTF8Type
and compression_options =
{sstable_compression:SnappyCompressor, chunk_length_kb:64}
and column_metadata = [
{column_type: super, column_name: address, validation_class: UTF8Type
column_metadata =[
{column_name: city, validation_class: UTF8Type}
{column_name: Street, validation_class: UTF8Type}
{column_name: zip, validation_class: UTF8Type}
{column_name: housnumber, validation_class: LongType}
];
这是可能吗?
如果我可以将一个超级列放在另一个超级列中,那就更好了。这样,超级列“地址”可以包含多个超级列“地址”,列:“street”、“zip”等。