gpt4 book ai didi

cassandra - com.datastax.driver.core.exceptions.InvalidQueryException : PRIMARY KEY part sequence found in SET part

转载 作者:行者123 更新时间:2023-12-04 03:39:35 32 4
gpt4 key购买 nike

我正在尝试更新表,然后出现此异常:

com.datastax.driver.core.exceptions.InvalidQueryException: PRIMARY KEY part sequence found in SET part.



我的表结构是
CREATE TABLE IF NOT EXISTS STYLINGBEE.LKPSTYLES(
STYLEID ASCII,
NAME ASCII,
IMAGE ASCII,
SEQUENCE INT,
ACTIVE BOOLEAN,
PRIMARY KEY (STYLEID,SEQUENCE)
)WITH CLUSTERING ORDER BY (SEQUENCE DESC);

最佳答案

虽然拥有完整的查询会有所帮助,但我可以从错误消息中看出您正在尝试 UPDATE一行的PRIMARY KEY .来自 DataStax documentation on the UPDATE command :

The UPDATE SET operation is not valid on a primary key field.

这就是您收到此特定错误消息的原因。如果插入的行包含需要更新的主键的一部分,则必须删除该行并重新插入。

关于cassandra - com.datastax.driver.core.exceptions.InvalidQueryException : PRIMARY KEY part sequence found in SET part,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27074271/

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