Cassandra中的复合列值?

编程入门 行业动态 更新时间:2024-10-23 19:32:51
本文介绍了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中的复合列值?

本文发布于:2023-10-24 17:00:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1524501.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Cassandra

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!