Python 使用Pyaccumulo删除Accumulo中的行
我正在尝试使用RowDeletingIterator删除一行。我正在运行Accumulo 1.5.0。这是我的Python 使用Pyaccumulo删除Accumulo中的行,python,thrift,accumulo,Python,Thrift,Accumulo,我正在尝试使用RowDeletingIterator删除一行。我正在运行Accumulo 1.5.0。这是我的 writer = conn.create_batch_writer("my_table") mut = Mutation("1234") mut.put(cf="", cq="", cv="", is_delete=True) writer.add_mutation(mut) writer.close() for r in conn.scan("my_table", scanrange
writer = conn.create_batch_writer("my_table")
mut = Mutation("1234")
mut.put(cf="", cq="", cv="", is_delete=True)
writer.add_mutation(mut)
writer.close()
for r in conn.scan("my_table", scanrange=Range(srow="1234", erow="1234"), iterators=[RowDeletingIterator()]):
print(r)
conn.close()
我正在打印记录,以验证扫描仪是否正在扫描适当的记录。遗憾的是,它们似乎没有被删除。我很感谢你的任何见解,因为皮亚库穆洛的文档不是最好的
我知道有一个bug要求在过度节俭地删除时使用时间戳,但当我指定ts字段时,除了现有记录外,我只看到一条空白记录。我对Pyaccumulo不是很熟悉,但我可以告诉您RowDeletingIterator不使用正常的删除条目。它只使用一个具有空列族、限定符和可见性的键以及DEL_ROW值来指示应删除整行。我会尝试不设置is_delete=True,并给条目一个DEL_ROW值,看看这是否符合您的要求。pyaccumulo中应该有一个delete_rows方法
def delete_rows(self, table, srow, erow):
self.client.deleteRows(self.login, table, srow, erow)
您可以这样使用它:
conn.delete_rows(table, srow, erow)
设置DEL_行的值似乎不起作用,我只是得到了一个cf=ROW_id和val=DEL_ROW的记录。您的意思是结果项的列族就是您在变量中设置的行id吗?