cassandra - 无法删除多行,获取 "Some partition key parts are missing: identifier"

标签 cassandra nosql

我是 Cassandra 的新手,在尝试删除表中的多行时遇到了一些问题。我有一个定义如下的表:

CREATE TABLE aze.isis_users (
  identifier text PRIMARY KEY,
  iteration_count int,
  password_expires_on date,
  passwordword blob,
  roleidentifier text,
  salt blob
) WITH additional_write_policy = '99p'
  AND bloom_filter_fp_chance = 0.01
  AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
  AND cdc = false
  AND comment = ''
  AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
  AND compression = {'chunk_length_in_kb': '16', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
  AND crc_check_chance = 1.0
  AND default_time_to_live = 0
  AND extensions = {}
  AND gc_grace_seconds = 864000
  AND max_index_interval = 2048
  AND memtable_flush_period_in_ms = 0
  AND min_index_interval = 128
  AND read_repair = 'BLOCKING'
  AND speculative_retry = '99p';

我希望能够使用 roleidentifier = lim_user 删除所有行

table

我在 2 个不同的查询中得到以下 2 个错误:

Error 1

Error 2

最佳答案

在 Cassandra 中不是这样工作的。您需要在 DELETE 命令中指定完整或部分主键。如果要通过非主键/分区键删除,则需要先找到具有该值的行,提取主键,然后通过主键删除。

您可以在 this answer 中找到实现此目的的方法.

关于cassandra - 无法删除多行,获取 "Some partition key parts are missing: identifier",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70953262/

相关文章:

c++ - Datastax Cassandra C++ 驱动程序中核心连接和 i/o 线程之间的区别

cassandra - 内部加入cassandra CQL

mongodb - 在 MongoDB 中为 friend 关系建模

Django + 什么NOSQL在生产中使用最成熟?

oracle - 大容量数据存储和处理

replication - Cassandra 数据复制问题

cassandra - 当表在集群中的多个节点之间复制时,COPY 在 cassandra 中如何工作?

python - 灯泡 python 连接到远程 TitanDB + Rexster

java - 如何在没有某些字段的情况下从 couchdb 获取文档?尽可能使用 Ektorp

c# - 在 RavenDB 中通过接口(interface)使用多态查询