I'm new to Cassandra and I've been having some issues trying to delete multiple rows in table. I have a table defined as follows:
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';
I would like to be able to delete all rows with roleidentifier = lim_user
I get the following 2 errors with 2 different query :
CodePudding user response:
It doesn't work this way in Cassandra. You need to have a full or partial primary key specified in the DELETE command. If you want to delete by non-primary/partition key, then you need first to find rows with that value, extract primary key, and then delete by primary key.
You can find ways to do that in this answer.
