One thing I ran into when using the Scan.addFamily / Scan.addColumn is that 
those two methods overwrite each other.  So, if you do Scan.addFamily("a"), and 
the family contains qualifiers x, y, and z; and then do 
Scan.addColumn("a","x"), you will not get the columns y and z back.  Similarly, 
if you do a Scan.addColumn("a","x"), and then a Scan.addFamily("a"), you will 
get the columns x, y, and z back.

Dave

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Stack
Sent: Wednesday, May 30, 2012 10:43 AM
To: [email protected]
Subject: Re: Scan addFamily vs FamilyFilter(EQUAL, ...)

On Wed, May 30, 2012 at 9:59 AM, Kevin <[email protected]> wrote:
> I am curious and trying to learn which method is best when wanting to limit
> a scan to a particular column or column family. The Scan class carries a
> Filter instance and a TreeMap of the family map and I am unsure how they
> get carried through to the server-side functionality. In terms of
> performance is there any difference between doing Scan.addFamily(x) and
> Scan.setFilter(new FamilyFilter(CompareFilter.CompareOp.EQUAL, x)?
>

There is probably not noticeable difference in performance but
Scan#addFamily is the more natural way of expressing column family
scoping.
St.Ack

Reply via email to