在Cassandra中,如何在将列值保留为空的情况下以列名保存数据? [英] In Cassandra, how is it possible to save data in a column name while leaving the column value empty?

查看:277
本文介绍了在Cassandra中,如何在将列值保留为空的情况下以列名保存数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到它被写成多个来源,对于Cassandra来说,将数据存储在列名称中而将列值保留为空是完全正常的。我不确定我是否完全理解这种可能性。有人可以用最好的示例模式对此进行更多说明吗?

I've seen it being written in multiple sources that it is perfectly normal, with Cassandra, to store data in the column name, while leaving the column value empty. I'm not sure I completely understand how that's possible. Can anyone throw more light on this, preferably with an example schema?

推荐答案

不,不再。这曾经是可能的。它需要旧的(3.x之前的版本的存储引擎)并使用基于Thrift的API。但是,使用CQL(和 new 存储引擎)构建的表要求所有列都预先定义,并且不允许在运行时使用(至少,与Thrift的方式不同)。

No, not any more. This used to be possible. It required the old (pre-3.x storage engine) and use of a Thrift-based API. But tables built with CQL (and the new storage engine) require all columns to be defined-up front, and do not allow it at runtime (at least, not in the same way that Thrift did).

上面提到的文章的日期为2015年,当时仍然可行。 Apache Cassandra是其中一种在短时间内发生了很大变化的技术,它们很快就会过时,一旦被接受的做法和建议就会过时。

The article referenced above is dated 2015, when this was still possible. Apache Cassandra is one of those techs that has changed a lot in a short time, quickly out-dating once accepted practices and recommendations.

这篇关于在Cassandra中,如何在将列值保留为空的情况下以列名保存数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆