cassandra上带复合键的有限查询中的顺序
在以下场景中:cassandra上带复合键的有限查询中的顺序,cassandra,time-series,composite-key,composite-primary-key,in-clause,Cassandra,Time Series,Composite Key,Composite Primary Key,In Clause,在以下场景中: CREATE TABLE temperature_by_day ( weatherstation_id text, date text, event_time timestamp, temperature text, PRIMARY KEY ((weatherstation_id,date),event_time) )WITH CLUSTERING ORDER BY (event_time DESC); INSERT INTO temperatur
CREATE TABLE temperature_by_day (
weatherstation_id text,
date text,
event_time timestamp,
temperature text,
PRIMARY KEY ((weatherstation_id,date),event_time)
)WITH CLUSTERING ORDER BY (event_time DESC);
INSERT INTO temperature_by_day(weatherstation_id,date,event_time,temperature)
VALUES ('1234ABCD','2013-04-03','2013-04-03 07:01:00','72F');
INSERT INTO temperature_by_day(weatherstation_id,date,event_time,temperature)
VALUES ('1234ABCD','2013-04-03','2013-04-03 08:01:00','74F');
INSERT INTO temperature_by_day(weatherstation_id,date,event_time,temperature)
VALUES ('1234ABCD','2013-04-04','2013-04-04 07:01:00','73F');
INSERT INTO temperature_by_day(weatherstation_id,date,event_time,temperature)
VALUES ('1234ABCD','2013-04-04','2013-04-04 08:01:00','76F');
如果我执行以下查询:
SELECT *
FROM temperature_by_day
WHERE weatherstation_id='1234ABCD'
AND date in ('2013-04-04', '2013-04-03') limit 2;
我意识到《卡桑德拉》的结果是按照《克劳萨》中相同的Patkey序列排序的。在这种情况下,我想知道预期结果是否总是“2013-04-04”当天的两条记录?Ie Cassadra尊重IN子句在结果排序中的顺序,即使在具有多个节点的场景中也是如此?从我可以看出,是的,它应该尊重具有多个节点的集群顺序。你看到不同的东西了吗?