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

Tak*_*rio 3 cql cassandra

我正在使用带有CQL 3.0的Cassandra 1.1.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 '='
Run Code Online (Sandbox Code Playgroud)

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

谢谢.

the*_*aul 8

WITH CLUSTERING ORDER语法仅在卡桑德拉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);
Run Code Online (Sandbox Code Playgroud)

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