Cassandra中的复合列值? [英] Composite Column Values in Cassandra?
问题描述
我们可以在Cassandra Column Family的每一列中有一个复合值吗?
Can we have a composite values in each columns in Cassandra Column Family?
user-id column1-name
123 (Column1-Value Column1-SchemaName Column1-LastModifiedDate)
userId是rowKey。
userId is the rowKey here. And same thing will be for other columns as well.
每个列值将包含以下三个常量:
Each column value will contain below three things always-
ByteType for Column-Value
UTF8Type for Column-SchemaName
DateType for LastModifiedDate
如果是,任何人都可以帮助我设计列族?我将使用Astyanax客户端插入上面的列族。
If yes, can anyone help me in designing the column family for this? I will be using Astyanax client to insert into above column family.
推荐答案
我不认为, Cassandra。您必须对列族进行反标准化或查看 Cassandra Collection 支持。如果您可以将值,模式名, LastModifiedDate 的数据模型数据类型限制为单一类型,则可能映射将有助于您的情况。
I don't think, it is at all possible in Cassandra. Either you have to de-normalized your Column Family or look after Cassandra Collection support. If you can restrict your data models data type for Value, SchemaName, LastModifiedDate to a single type, then probably Map will be helpful in your case.
这篇关于Cassandra中的复合列值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!