gpt4 book ai didi

Cassandra Upsert 不适用于每一列

转载 作者:行者123 更新时间:2023-12-04 07:30:16 25 4
gpt4 key购买 nike

我正在尝试更新测试键空间和表中的记录。当我插入一条记录时,接受一个列值更改,而另一个不接受。 (注意:尽管没有错误消息,我也无法删除记录)
观察 middle_initial 是如何不更新的,而 title 是如何......什么给出的?
//前

cqlsh:my_keyspace> SELECT * FROM user;

last_name | first_name | middle_initial | title
-----------+------------+----------------+-------
Rodriguez | Mary | Q | null
Rodriquez | Mary | Q | O
Nguyen | Bill | null | Mr.
Nguyen | Wanda | null | Mrs.
//命令
cqlsh:my_keyspace> UPDATE user SET middle_initial = 'F', title = 'U' WHERE last_name = 'Rodriquez' AND first_name = 'Mary';
//后
cqlsh:my_keyspace> SELECT * FROM user;

last_name | first_name | middle_initial | title
-----------+------------+----------------+-------
Rodriguez | Mary | Q | null
Rodriquez | Mary | Q | U
Nguyen | Bill | null | Mr.
Nguyen | Wanda | null | Mrs.
//附加信息
CREATE KEYSPACE my_keyspace WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}  AND durable_writes = true;

CREATE TABLE my_keyspace.user (
last_name text,
first_name text,
middle_initial text,
title text,
PRIMARY KEY (last_name, first_name)
) WITH CLUSTERING ORDER BY (first_name ASC)
AND bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
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_chance = 0.0
AND speculative_retry = '99PERCENTILE';

最佳答案

马尼什是对的。我的 middle_initial 时间戳设置为 future 日期 1623699999999999
要删除记录(这实际上是我的目标),我做了:

cqlsh:my_keyspace> DELETE FROM user USING timestamp 1623699999999999 WHERE first_name = 'Mary' AND last_name = 'Rodriquez';

关于Cassandra Upsert 不适用于每一列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67973412/

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