【发布时间】:2020-12-11 08:03:44
【问题描述】:
我想从 Casandra 表中删除一个特定的行,但我不能。除了这个,我可以从表中删除任何其他人。我放了删除查询,但什么也没发生:
cqlsh> delete from sales.tbl where orderid=999999 and orderdate='2019/01/01';
cqlsh>
cqlsh> select * from sales.tbl where orderid=999999 and orderdate='2019/01/01';
orderid | orderdate | country | itemtype | orderpriority | region | saleschannel | shipdate | totalcost | totalprofit | totalrevenue | unitcost | unitprice | unitssold
---------+------------+---------+----------+---------------+---------------+--------------+------------+-----------+-------------+--------------+----------+-----------+-----------
999999 | 2019/01/01 | Canada | Stuff | N | North America | Offline | 2019/01/02 | 100 | 0 | 100 | 0 | 1 | 1
(1 rows)
cqlsh>
这是这个表的 shema:
CREATE TABLE sales.tbl1 (
orderid bigint,
orderdate text,
country text,
itemtype text,
orderpriority text,
region text,
saleschannel text,
shipdate text,
totalcost float,
totalprofit float,
totalrevenue float,
unitcost float,
unitprice float,
unitssold int,
PRIMARY KEY (orderid, orderdate) ) WITH CLUSTERING ORDER BY (orderdate ASC)
AND bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'}
AND comment = ''
AND compaction = {'class': 'SizeTieredCompactionStrategy'}
AND compression = {'sstable_compression': '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 = 1
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 = '99.0PERCENTILE';
有什么建议吗?
【问题讨论】:
-
你能显示行如何进入那里的代码吗?
-
只能删除orderid吗?也许日期格式不是您所期望的?尝试不同的选择标准。数据库日志对此有何评论?您是否启用了自动提交(如果没有则提交)。删除时没有消息? 仅供参考您在查询中的表名与
create table中的表名不匹配...