1

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?

Brian Tompsett - 汤莱恩
  • 5,195
  • 62
  • 50
  • 120
tom
  • 13,143
  • 18
  • 63
  • 120
  • Probably the reason your code doesn't return all columns is because it defaults to 100. You need to call `sTemplate.setCount()` to specify a higher value. – rs_atl Jun 12 '12 at 17:25

1 Answers1

2
Mutator mutator = HFactory.createMutator(keyspace, key_serializer);
mutator.addSubDelete(key, column_family, supercol, subcol, super_serializer, sub_serializer);
mutator.execute();
rs_atl
  • 8,825
  • 1
  • 20
  • 28