You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Nicolas Phung <ni...@gmail.com> on 2013/11/18 10:42:50 UTC

HBase import command line with filter

Hello,

We are using HBase hbase-0.94.6+132 with cloudera distribution. We're
trying to do a selective taImport with HBase filter, but can't get it work:
http://stackoverflow.com/questions/20007190/hbase-import-command-line-with-filter

I don't know if it's really possible but the command prompt suggest it is.
We manage to find the following ticket
https://issues.apache.org/jira/browse/HBASE-7702 but haven't been able to
use it for the command line.

If anyone can send me some pointers on whatever this is really possible or
now and how to do it properly.

Thanks.

Nicolas

Re: HBase import command line with filter

Posted by Nicolas Phung <np...@pwspace.com>.
Hi,

We have tried using the following command in the shell without success :

hbase org.apache.hadoop.hbase.mapreduce.Import -Dimport.filter.class=org.
apache.hadoop.hbase.filter.SingleColumnValueFilter
-Dimport.filter.args='Bytes.toBytes("t")','Bytes.toBytes("trt")','=','new
BinaryComparator (Bytes.toBytes("imp"))' tracking-test-backup
tracking-export

hbase org.apache.hadoop.hbase.mapreduce.Import
-Dimport.filter.class=org.apache.hadoop.hbase.filter.SingleColumnValueFilter
-Dimport.filter.args='Bytes.toBytes("t")','Bytes.toBytes("trt")','CompareFilter.CompareOp.valueOf("EQUAL")','new
BinaryComparator (Bytes.toBytes("imp"))' tracking-test-backup
tracking-export

hbase org.apache.hadoop.hbase.mapreduce.Import
-Dimport.filter.class=org.apache.hadoop.hbase.filter.SingleColumnValueFilter
-Dimport.filter.args='Bytes.toBytes("t")','Bytes.toBytes("trt")','CompareFilter.CompareOp.EQUAL','new
BinaryComparator (Bytes.toBytes("imp"))' tracking-test-backup
tracking-export

Thanks for you reply.


On Mon, Nov 18, 2013 at 4:09 PM, Ted Yu <yu...@gmail.com> wrote:

> bq. -Dimport.filter.args=<args>
>
> Can you show us your <args> ?
>
> BTW from SingleColumnValueFilter.createFilterFromArguments(), you can find
> the correct order of arguments:
>
>     byte [] family =
> ParseFilter.removeQuotesFromByteArray(filterArguments.get(0));
>     byte [] qualifier =
> ParseFilter.removeQuotesFromByteArray(filterArguments.get(1));
>     CompareOp compareOp =
> ParseFilter.createCompareOp(filterArguments.get(2));
>
>
> On Mon, Nov 18, 2013 at 1:42 AM, Nicolas Phung <nicolas.phung@gmail.com
> >wrote:
>
> > Hello,
> >
> > We are using HBase hbase-0.94.6+132 with cloudera distribution. We're
> > trying to do a selective taImport with HBase filter, but can't get it
> work:
> >
> >
> http://stackoverflow.com/questions/20007190/hbase-import-command-line-with-filter
> >
> > I don't know if it's really possible but the command prompt suggest it
> is.
> > We manage to find the following ticket
> > https://issues.apache.org/jira/browse/HBASE-7702 but haven't been able
> to
> > use it for the command line.
> >
> > If anyone can send me some pointers on whatever this is really possible
> or
> > now and how to do it properly.
> >
> > Thanks.
> >
> > Nicolas
> >
>



-- 
*Nicolas Phung** - Big Data Engineer*nphung@powerspace.com<np...@pwspace.com>
[image: --------------------------------------------------][image:
powerspace] <http://www.powerspace.com/>Powerspace France | 13 rue de
Turbigo | 75002 Paris
fax. +34 935 504 359 - www.powerspace.com[image:
--------------------------------------------------][image:
In]<http://www.linkedin.com/companies/powerspace?trk=fc_badge>[image:
t] <http://twitter.com/pwspace>Hot Jobs in
Barcelona<http://www.powerspace.com/jobs>

Re: HBase import command line with filter

Posted by Ted Yu <yu...@gmail.com>.
bq. -Dimport.filter.args=<args>

Can you show us your <args> ?

BTW from SingleColumnValueFilter.createFilterFromArguments(), you can find
the correct order of arguments:

    byte [] family =
ParseFilter.removeQuotesFromByteArray(filterArguments.get(0));
    byte [] qualifier =
ParseFilter.removeQuotesFromByteArray(filterArguments.get(1));
    CompareOp compareOp =
ParseFilter.createCompareOp(filterArguments.get(2));


On Mon, Nov 18, 2013 at 1:42 AM, Nicolas Phung <ni...@gmail.com>wrote:

> Hello,
>
> We are using HBase hbase-0.94.6+132 with cloudera distribution. We're
> trying to do a selective taImport with HBase filter, but can't get it work:
>
> http://stackoverflow.com/questions/20007190/hbase-import-command-line-with-filter
>
> I don't know if it's really possible but the command prompt suggest it is.
> We manage to find the following ticket
> https://issues.apache.org/jira/browse/HBASE-7702 but haven't been able to
> use it for the command line.
>
> If anyone can send me some pointers on whatever this is really possible or
> now and how to do it properly.
>
> Thanks.
>
> Nicolas
>