我有订单数据问题cassandra数据库。 这是我的表结构:通过创建日期在Cassandra
CREATE TABLE posts (
id uuid,
created_at timestamp,
comment_enabled boolean,
content text,
enabled boolean,
meta map<text, text>,
post_type tinyint,
summary text,
title text,
updated_at timestamp,
url text,
user_id uuid,
PRIMARY KEY (id, created_at)
) WITH CLUSTERING ORDER BY (created_at DESC)
,当我运行此查询,我得到了以下信息:
查询:
select * from posts order by created_at desc;
消息:
ORDER BY is only supported when the partition key is restricted by an EQ or an IN.
点
或者该查询返回的数据不排序:
select * from posts
你的意思是这个查询应该返回默认排序的数据? –
我试过这个查询,但不幸的是相同的输出(数据没有排序) –
我的意思是我写的是:这个查询*已经返回由令牌(id)函数排序的数据。 – xmas79