accumulo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Billie Rinaldi <>
Subject Re: Multicolumn returns from the shell (egrep)
Date Fri, 10 Aug 2012 16:07:09 GMT
There's an iterator in 1.4 that would help with this, RowFilter, but you
would still have to write custom Java to select which rows you want (i.e.,
the ones that have a particular value in column 'a').  If you're
constrained to the command line, I would do something like the following.
It does one scan for all the rows that have 'colfa:colqa' and 'value', then
uses the result to construct scans for the 'colfa:colqa' and 'colfb:colqb'
columns of the rows that were returned from the first scan.

$ echo "table tablename
setscaniter -regex -p 1 -t tablename


scan -c colfa:colqa -np" | bin/accumulo shell -u username -p password |
grep " value$" | awk '{print "scan -b",$1,"-e",$1,"-c
colfa:colqa,colfb:colqb"}' > file
$ accumulo shell -u username -p password
username@instance> table tablename
username@instance tablename> execfile file

On Fri, Aug 10, 2012 at 10:50 AM, Kristopher Kane <>wrote:

> Me again.  That guy that only uses the shell.
> This time:  I'm still constrained to the shell in 1.3.4
> What I'm trying to do:  Use egrep to match a value in column a, but,
> return both column a and column b from the same egrep even though column b
> doesn't have a matching value.
> I could write the IDs out then do another search on column b but I'd
> rather get this in one shot.
> Example:
> egrep "<expr>" -c
> columnfamily:columnqualifier(a),columnfamily:columnqualifier(b)
> Thanks,
> -Kris

View raw message