gpt4 book ai didi

cassandra - Cassandra w/CQL3 是否支持 "WITH CLUSTERING ORDER"选项?

转载 作者:行者123 更新时间:2023-12-01 09:34:23 25 4
gpt4 key购买 nike

我正在使用 Cassandra 1.1.0 和 CQL 3.0。

创建表时出现如下错误。我提到了http://www.datastax.com/dev/blog/cql3-evolutions

cqlsh:test> CREATE TABLE timeseries (
... event_type text,
... insertion_time timestamp,
... event blob,
... PRIMARY KEY (event_type, insertion_time)
... ) WITH CLUSTERING ORDER BY insertion_time DESC;
Bad Request: line 6:22 mismatched input 'ORDER' expecting '='

这是无效的查询吗?你有什么建议吗?

谢谢。

最佳答案

WITH CLUSTERING ORDER 语法仅在 Cassandra 1.1.1(前几天刚刚发布)中添加,因此在 1.1.0 中不起作用。

此外,该示例在集群定义周围缺少一些括号。你想要:

CREATE TABLE timeseries (
event_type text,
insertion_time timestamp,
event blob,
PRIMARY KEY (event_type, insertion_time)
) WITH CLUSTERING ORDER BY (insertion_time DESC);

希望对您有所帮助。我会让那篇文章的作者知道这个问题。

关于cassandra - Cassandra w/CQL3 是否支持 "WITH CLUSTERING ORDER"选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10871947/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com