gpt4 book ai didi

cassandra - CQL : Bad Request: Missing CLUSTERING ORDER for column

转载 作者:行者123 更新时间:2023-12-04 14:28:03 25 4
gpt4 key购买 nike

这个 CQL 查询有什么问题

cqlsh> create table citybizz.notifications(
... userId varchar,
... notifId UUID,
... notification varchar,
... time bigint,read boolean,
... primary key (userId, notifId,time)
... ) with clustering order by (time desc);

它抛出 Bad Request: Missing CLUSTERING ORDER for column notifid .我正在使用 cassandra 1.2.2

最佳答案

您还需要指定 notifId 的顺序:

create table citybizz.notifications(
userId varchar,
notifId UUID,
notification varchar,
time bigint,read boolean,
primary key (userId, notifId,time)
) with clustering order by (notifId asc, time desc);

Cassandra 不假定其他集群键的默认排序 (asc),因此您需要指定它。

关于cassandra - CQL : Bad Request: Missing CLUSTERING ORDER for column,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23185331/

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