Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Accumulo >> mail # user >> scan iterator that rolls up col vis


Copy link to this message
-
Re: scan iterator that rolls up col vis
you should be able to roll up on keys with a condition similar to:

if( source.hasTop() ) {
  Key start = new Key(source.getTopKey()); // avoid instance-reuse issues
  long count = 0;
  while( source.hasTop() && start.equals( source.getTopKey(),
PartialKey.ROW_COLFAM_COLQUAL_COLVIS ) {
    count += deserialize(source.getTopValue());
    source.next();
  }
  Value new_top_value = serialize(count);
  // start can represent the top key of the iterator
}

We can flesh this out further if you run into issues. I think that we may
need to set the start key's timestamp to 0 so that it sorts after all the
other cells with a similar prefix.
On Tue, Jul 1, 2014 at 10:41 PM, Matthew Purdy <
[EMAIL PROTECTED]> wrote: