|
|
-
Applying QualifierFilter to one column family only.
David Koch 2012-07-18, 22:06
Hello,
When scanning a table with 2 column families, is it possible to apply a QualifierFilter selectively to one family but still include the other family in the scan?
The layout of my table is as follows:
<rowkey> T:<timestamp> --> <data>, S:<summary_item> --> <value>
For each <rowkey> family T contains timestamp/data key/value pairs. Column S contains summary information about this row key.
I want to apply a QualifierFilter to column T only - i.e filter by <timestamp> but return also all of S whenever the set of key/values matched in T is not empty. Is this doable using standard HBase filters? If so, how? If not could I implement such a filter myself using FilterBase?
Thank you,
/David
+
David Koch 2012-07-18, 22:06
-
RE: Applying QualifierFilter to one column family only.
Anoop Sam John 2012-07-19, 05:05
Hi David, You want the below use case in scan Table :T1 -------------- CF : T CF: S q1 q2.. q1 q2 ..............
Now in Scan u want to scan all the qualifiers under S and one qualifier under T. (I think I got ur use case correctly)
Well this use case u can achieve with out using any filter also. Scan s = new Scan() s.addFamily(S); // Tells to add all the qualifier(KVs) under this CF in the result s.addColumn(T,q1) Use this scan object for your getScanner. Using the addColumn you can add more than one qualifier under one CF too.
Hope this helps u.
-Anoop- ________________________________________ From: David Koch [[EMAIL PROTECTED]] Sent: Thursday, July 19, 2012 3:36 AM To: [EMAIL PROTECTED] Subject: Applying QualifierFilter to one column family only.
Hello,
When scanning a table with 2 column families, is it possible to apply a QualifierFilter selectively to one family but still include the other family in the scan?
The layout of my table is as follows:
<rowkey> T:<timestamp> --> <data>, S:<summary_item> --> <value>
For each <rowkey> family T contains timestamp/data key/value pairs. Column S contains summary information about this row key.
I want to apply a QualifierFilter to column T only - i.e filter by <timestamp> but return also all of S whenever the set of key/values matched in T is not empty. Is this doable using standard HBase filters? If so, how? If not could I implement such a filter myself using FilterBase?
Thank you,
/David
+
Anoop Sam John 2012-07-19, 05:05
-
Re: Applying QualifierFilter to one column family only.
David Koch 2012-07-19, 08:27
Hello Anoop,
Thank you for your answer. The QualifierFilter on T specifies a minimum value not one that has to be matched exactly, so merely adding a specific qualifier value directly to the scan does not work if I understand correctly :-/
/David On Thu, Jul 19, 2012 at 7:05 AM, Anoop Sam John <[EMAIL PROTECTED]> wrote:
> Hi David, > You want the below use case in scan > Table :T1 > -------------- > CF : T CF: S > q1 q2.. q1 q2 .............. > > Now in Scan u want to scan all the qualifiers under S and one qualifier > under T. (I think I got ur use case correctly) > > Well this use case u can achieve with out using any filter also. > Scan s = new Scan() > s.addFamily(S); // Tells to add all the qualifier(KVs) under this CF in > the result > s.addColumn(T,q1) > Use this scan object for your getScanner. > Using the addColumn you can add more than one qualifier under one CF too. > > Hope this helps u. > > -Anoop- > ________________________________________ > From: David Koch [[EMAIL PROTECTED]] > Sent: Thursday, July 19, 2012 3:36 AM > To: [EMAIL PROTECTED] > Subject: Applying QualifierFilter to one column family only. > > Hello, > > When scanning a table with 2 column families, is it possible to apply > a QualifierFilter selectively to one family but still include the other > family in the scan? > > The layout of my table is as follows: > > <rowkey> T:<timestamp> --> <data>, S:<summary_item> --> <value> > > For each <rowkey> family T contains timestamp/data key/value pairs. Column > S contains summary information about this row key. > > I want to apply a QualifierFilter to column T only - i.e filter by > <timestamp> but return also all of S whenever the set of key/values matched > in T is not empty. Is this doable using standard HBase filters? If so, how? > If not could I implement such a filter myself using FilterBase? > > Thank you, > > /David >
+
David Koch 2012-07-19, 08:27
-
RE: Applying QualifierFilter to one column family only.
Anoop Sam John 2012-07-20, 03:10
Yes I was having this doubt. So if you know exactly the qualifier names in advance you can use this scan way. Else filter only u can use. QualifierFilter just checks the qualifier name only which CF it is part of is not checked. So the similar qualifier names in both T and S will get filtered out. You can create a simple filter of your own and plugin the same into HBase and use? Here you can pass the CF name also and in the filterKeyValue() u can consider the CF name too. I think it should be an easy job :)
-Anoop- _________________________________ From: David Koch [[EMAIL PROTECTED]] Sent: Thursday, July 19, 2012 1:57 PM To: [EMAIL PROTECTED] Subject: Re: Applying QualifierFilter to one column family only.
Hello Anoop,
Thank you for your answer. The QualifierFilter on T specifies a minimum value not one that has to be matched exactly, so merely adding a specific qualifier value directly to the scan does not work if I understand correctly :-/
/David On Thu, Jul 19, 2012 at 7:05 AM, Anoop Sam John <[EMAIL PROTECTED]> wrote:
> Hi David, > You want the below use case in scan > Table :T1 > -------------- > CF : T CF: S > q1 q2.. q1 q2 .............. > > Now in Scan u want to scan all the qualifiers under S and one qualifier > under T. (I think I got ur use case correctly) > > Well this use case u can achieve with out using any filter also. > Scan s = new Scan() > s.addFamily(S); // Tells to add all the qualifier(KVs) under this CF in > the result > s.addColumn(T,q1) > Use this scan object for your getScanner. > Using the addColumn you can add more than one qualifier under one CF too. > > Hope this helps u. > > -Anoop- > ________________________________________ > From: David Koch [[EMAIL PROTECTED]] > Sent: Thursday, July 19, 2012 3:36 AM > To: [EMAIL PROTECTED] > Subject: Applying QualifierFilter to one column family only. > > Hello, > > When scanning a table with 2 column families, is it possible to apply > a QualifierFilter selectively to one family but still include the other > family in the scan? > > The layout of my table is as follows: > > <rowkey> T:<timestamp> --> <data>, S:<summary_item> --> <value> > > For each <rowkey> family T contains timestamp/data key/value pairs. Column > S contains summary information about this row key. > > I want to apply a QualifierFilter to column T only - i.e filter by > <timestamp> but return also all of S whenever the set of key/values matched > in T is not empty. Is this doable using standard HBase filters? If so, how? > If not could I implement such a filter myself using FilterBase? > > Thank you, > > /David >
+
Anoop Sam John 2012-07-20, 03:10
-
Re: Applying QualifierFilter to one column family only.
Anoop Sam John 2012-07-20, 03:12
>Yes I was having this doubt. Yes I was having this doubt abt ur use case. I assumed ur use case is like u know the qualifier names in advance. :) ____________________________________ From: Anoop Sam John Sent: Friday, July 20, 2012 8:40 AM To: [EMAIL PROTECTED] Subject: RE: Applying QualifierFilter to one column family only.
Yes I was having this doubt. So if you know exactly the qualifier names in advance you can use this scan way. Else filter only u can use. QualifierFilter just checks the qualifier name only which CF it is part of is not checked. So the similar qualifier names in both T and S will get filtered out. You can create a simple filter of your own and plugin the same into HBase and use? Here you can pass the CF name also and in the filterKeyValue() u can consider the CF name too. I think it should be an easy job :)
-Anoop- _________________________________ From: David Koch [[EMAIL PROTECTED]] Sent: Thursday, July 19, 2012 1:57 PM To: [EMAIL PROTECTED] Subject: Re: Applying QualifierFilter to one column family only.
Hello Anoop,
Thank you for your answer. The QualifierFilter on T specifies a minimum value not one that has to be matched exactly, so merely adding a specific qualifier value directly to the scan does not work if I understand correctly :-/
/David On Thu, Jul 19, 2012 at 7:05 AM, Anoop Sam John <[EMAIL PROTECTED]> wrote:
> Hi David, > You want the below use case in scan > Table :T1 > -------------- > CF : T CF: S > q1 q2.. q1 q2 .............. > > Now in Scan u want to scan all the qualifiers under S and one qualifier > under T. (I think I got ur use case correctly) > > Well this use case u can achieve with out using any filter also. > Scan s = new Scan() > s.addFamily(S); // Tells to add all the qualifier(KVs) under this CF in > the result > s.addColumn(T,q1) > Use this scan object for your getScanner. > Using the addColumn you can add more than one qualifier under one CF too. > > Hope this helps u. > > -Anoop- > ________________________________________ > From: David Koch [[EMAIL PROTECTED]] > Sent: Thursday, July 19, 2012 3:36 AM > To: [EMAIL PROTECTED] > Subject: Applying QualifierFilter to one column family only. > > Hello, > > When scanning a table with 2 column families, is it possible to apply > a QualifierFilter selectively to one family but still include the other > family in the scan? > > The layout of my table is as follows: > > <rowkey> T:<timestamp> --> <data>, S:<summary_item> --> <value> > > For each <rowkey> family T contains timestamp/data key/value pairs. Column > S contains summary information about this row key. > > I want to apply a QualifierFilter to column T only - i.e filter by > <timestamp> but return also all of S whenever the set of key/values matched > in T is not empty. Is this doable using standard HBase filters? If so, how? > If not could I implement such a filter myself using FilterBase? > > Thank you, > > /David >
+
Anoop Sam John 2012-07-20, 03:12
-
RE: Applying QualifierFilter to one column family only.
Dhaval Shah 2012-07-20, 09:27
Alternately you can use a filter list and say first column family and qualifier filter or second column family.. ------------------------------ On Fri 20 Jul, 2012 8:40 AM IST Anoop Sam John wrote:
>Yes I was having this doubt. So if you know exactly the qualifier names in advance you can use this scan way. >Else filter only u can use. >QualifierFilter just checks the qualifier name only which CF it is part of is not checked. >So the similar qualifier names in both T and S will get filtered out. >You can create a simple filter of your own and plugin the same into HBase and use? Here you can pass the CF name also and in the filterKeyValue() u can consider the CF name too. I think it should be an easy job :) > >-Anoop- >_________________________________ >From: David Koch [[EMAIL PROTECTED]] >Sent: Thursday, July 19, 2012 1:57 PM >To: [EMAIL PROTECTED] >Subject: Re: Applying QualifierFilter to one column family only. > >Hello Anoop, > >Thank you for your answer. The QualifierFilter on T specifies a minimum >value not one that has to be matched exactly, so merely adding a specific >qualifier value directly to the scan does not work if I understand >correctly :-/ > >/David > > >On Thu, Jul 19, 2012 at 7:05 AM, Anoop Sam John <[EMAIL PROTECTED]> wrote: > >> Hi David, >> You want the below use case in scan >> Table :T1 >> -------------- >> CF : T CF: S >> q1 q2.. q1 q2 .............. >> >> Now in Scan u want to scan all the qualifiers under S and one qualifier >> under T. (I think I got ur use case correctly) >> >> Well this use case u can achieve with out using any filter also. >> Scan s = new Scan() >> s.addFamily(S); // Tells to add all the qualifier(KVs) under this CF in >> the result >> s.addColumn(T,q1) >> Use this scan object for your getScanner. >> Using the addColumn you can add more than one qualifier under one CF too. >> >> Hope this helps u. >> >> -Anoop- >> ________________________________________ >> From: David Koch [[EMAIL PROTECTED]] >> Sent: Thursday, July 19, 2012 3:36 AM >> To: [EMAIL PROTECTED] >> Subject: Applying QualifierFilter to one column family only. >> >> Hello, >> >> When scanning a table with 2 column families, is it possible to apply >> a QualifierFilter selectively to one family but still include the other >> family in the scan? >> >> The layout of my table is as follows: >> >> <rowkey> T:<timestamp> --> <data>, S:<summary_item> --> <value> >> >> For each <rowkey> family T contains timestamp/data key/value pairs. Column >> S contains summary information about this row key. >> >> I want to apply a QualifierFilter to column T only - i.e filter by >> <timestamp> but return also all of S whenever the set of key/values matched >> in T is not empty. Is this doable using standard HBase filters? If so, how? >> If not could I implement such a filter myself using FilterBase? >> >> Thank you, >> >> /David >>
+
Dhaval Shah 2012-07-20, 09:27
|
|