Question

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?

Était-ce utile?

La solution

Mutator mutator = HFactory.createMutator(keyspace, key_serializer);
mutator.addSubDelete(key, column_family, supercol, subcol, super_serializer, sub_serializer);
mutator.execute();
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top