Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 带有更新查询的Cassandra问题_Python_Cassandra - Fatal编程技术网

Python 带有更新查询的Cassandra问题

Python 带有更新查询的Cassandra问题,python,cassandra,Python,Cassandra,Cassandra无法更新列表(uuid)列类型,但可以更新其他列。在Python中首先插入然后更新时会发生这种情况,但如果我们将睡眠放在更新查询之前,然后更新查询能够更新列表(uuid)列。 可能的原因是什么 更新查询很简单: update a set tids = [d181cf28-1e60-4120-92c4-902dfec88a4c] where cid=d181cf28-1e60-4120-92c4-902dfec88a4a and did=e3e8ac10-47b4-48b6-9b

Cassandra无法更新列表(uuid)列类型,但可以更新其他列。在Python中首先插入然后更新时会发生这种情况,但如果我们将睡眠放在更新查询之前,然后更新查询能够更新列表(uuid)列。 可能的原因是什么

更新查询很简单:

update a set tids = [d181cf28-1e60-4120-92c4-902dfec88a4c] where cid=d181cf28-1e60-4120-92c4-902dfec88a4a and did=e3e8ac10-47b4-48b6-9b72-302a1d98456d and cname='m_2017' and vn=0 IF EXISTS 

最后,我在Cassandra文档中找到了答案:

在我的场景中,事务的顺序是

删除(如果存在则不删除)->插入(如果不存在则不删除)->更新(如果存在)


在这个序列中,最后一次更新是轻量级事务。因此,如果我们使整个序列轻量级,那么它就解决了我的问题。另外,有时这个序列工作正常,有时它无法更新行

请显示您的代码。我已显示查询。这是在windows 7系统上发生的。您能告诉我在cassandra中频繁插入和更新的最佳方式是什么吗?