문제

I am trying to delete a sub-column of a super column family. I tried the following code but it won't work when the super column family has many super columns, it only returns partial super columns.

SuperCfResult<UUID, Long, UUID> superCfResult = sTemplate.querySuperColumns(key);
Collection<Long> supercolumns = superCfResult.getSuperColumns();

Another approach would be to build a SuperSliceQuery with the range that would return all the super columns, and then loop thru to find the one that has match and delete it. It works but it definitely overkill and has performance cost.

Is there a better solution for the purpose?

도움이 되었습니까?

해결책

Mutator mutator = HFactory.createMutator(keyspace, key_serializer);
mutator.addSubDelete(key, column_family, supercol, subcol, super_serializer, sub_serializer);
mutator.execute();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top