我有訂單數據問題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