与CQL 3创建组合柱(没有键) [英] Creating composite COLUMNS (not keys) with CQL 3

查看:111
本文介绍了与CQL 3创建组合柱(没有键)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

本文讨论可能的方式定制列表3,可用于创建组合柱在卡桑德拉1.1。他们只是想法。没有什么是官方的,而Datastax文档不包括这(只组合键)。

This article discusses possible ways CQL 3 could be used for creating composite columns in Cassandra 1.1. They are just ideas. Nothing is official, and the Datastax documentation doesn't cover this (only composite keys).

据我了解,复合列列数只共同拥有一个值。

As I understand it, composite columns are a number of columns that together have only one value.

如何与CQL创建它们?

How do you create them with CQL?

修改

我将使用C#接口到卡桑德拉。 CQL看起来简单易用,这就是为什么我要使用它。

I will be using C# to interface into Cassandra. CQL looks straightforward to use, which is why I want to use it.

推荐答案

您已经有了一对夫妇的概念混淆,我认为。很可能这是Datastax文件的故障;如果您有什么好的建议作出更清楚你有一个更好的画面后,我会很高兴向他们发送的。

You've got a couple concepts confused, I think. Quite possibly this is the fault of the Datastax documentation; if you have any good suggestions for making it clearer after you have a better picture, I'll be glad to send them on.

在的组合键的东西Datastax文档的实际上是在谈论复合卡桑德拉列。究其原因,混乱的是,在CQL 3行不直接映射到存储引擎行(你当你使用节俭接口工作)。 复合键在一个CQL表的上下文只是意味着它由多列,其中是由的在存储层的复合列实现的主键

The "composite keys" stuff in the Datastax docs is actually talking about composite Cassandra columns. The reason for the confusion is that rows in CQL 3 do not map directly to storage engine rows (what you work with when you use the thrift interface). "Composite key" in the context of a CQL table just means a primary key which consists of multiple columns, which is implemented by composite columns at the storage layer.

本文是更好的解释之一是如何映射发生,为什么CQL模型一般是比较容易思考的问题。

This article is one of the better explanations as to how the mapping happens and why the CQL model is generally easier to think about.

通过这种使用,第一CQL列成为作为存储引擎分区键。

With this sort of use, the first CQL column becomes being the storage engine partition key.

由于卡珊德拉1.2(开发中),所以也可以创建使用CQL复合存储引擎按键,通过把额外的括号中的主键定义的定制列表列,这将是左右存储在分区键(请参见 CASSANDRA-4179 ),但是这可能会是例外,而不是该规则。

As of Cassandra 1.2 (in development), it's also possible to create composite storage engine keys using CQL, by putting extra parentheses in the PRIMARY KEY definition around the CQL columns that will be stored in the partition key (see CASSANDRA-4179), but that's probably going to be the exception, not the rule.

这篇关于与CQL 3创建组合柱(没有键)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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