防止创建墓碑 [英] Prevent tombstones creation

查看:79
本文介绍了防止创建墓碑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在不为任何列创建逻辑删除的情况下执行对Cassandra表的插入。我正在使用与此类似的查询:

I need to perform an insert to Cassandra table without creating tombstones for any column. I am using a query similar to this :

插入my_table(col1,col2,col3)values(val1,val2,null)

其中col1,col2和col3都是my_table中的属性。
除了在我们的查询中仅传递非空属性并使cassandra将其余属性设置为 col3 以外,是否还有其他解决方案或解决方法来防止创建 col3 的逻辑删除

where col1, col2 and col3 are all the attributes in my_table. Is there any other solution or workaround to prevent tombstone creation for say col3 apart from passing only non-null attributes in our query and letting cassandra set the remaining attributes to null?

推荐答案

在插入的内容中不要包含 col3 只是不会设置任何内容。

Don't include col3 in your insert and it just wont set anything.

insert into my_table(col1,col2) values(val1,val2)

如果对磁盘的结构感到好奇,请执行 nodetool flush 并在其上运行sstabledump创建的sstable可以看到差异。

If curious about structure on disk, do a nodetool flush and run sstabledump on the sstable created to see difference.

这篇关于防止创建墓碑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆