cql:invalidrequest:来自服务器的错误:code=2200[无效查询]

piok6c0g  于 2021-06-14  发布在  Cassandra
关注(0)|答案(1)|浏览(368)
create table cd_ml_api.sf_leads (
    id timeuuid,
    email text ,
    cdh_org text,
    source_of_funds text ,
    currency_purpose text ,
    created_date timestamp,
    last_modified_date timestamp,
    PRIMARY KEY (email, last_modified_date)
)  WITH CLUSTERING ORDER BY (id DESC);

Cassandra终端显示错误:
invalidrequest:来自服务器的错误:code=2200[无效查询]
message=“缺少列上次修改日期的聚类顺序”

mitkmikd

mitkmikd1#

create table cd_ml_api.sf_leads (
    id timeuuid,
    email text ,
    cdh_org text,
    source_of_funds text ,
    currency_purpose text ,
    created_date timestamp,
    last_modified_date timestamp,
    PRIMARY KEY (email, last_modified_date)
)  WITH CLUSTERING ORDER BY (last_modified_date DESC);

cassandra只能按聚类键排序。为了按id排序,它必须是集群键的一部分。

相关问题