简体   繁体   English

PIG-HBASE-HBaseStorage键过滤器(gt,lt)

[英]PIG - HBASE - HBaseStorage key filter (gt, lt)

In a PIG script, I'm using HBaseStorage to load all the rows from an HBase-table. 在PIG脚本中,我正在使用HBaseStorage从HBase表加载所有行。 However, I'd like to filter the rows by the rowkey. 但是,我想通过rowkey来过滤行。

I looked at the source code, and i can send in -gt & -lt through the constructor. 我查看了源代码,并且可以通过构造函数发送-gt&-lt。 However, I can't figure out how to pass my value into the constructor. 但是,我不知道如何将我的值传递给构造函数。 It is a byte[]... 这是一个字节[] ...

Here is where I'm at: 这是我的位置:

LOAD 'hbase://TABLE' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage('CF:I','-caster HBaseBinaryConverter') AS (product_id:bytearray);

If possible could you pls provide sample code... 如果可能,请提供示例代码...

You can use "\\x" with the hex digits to express the binary value. 您可以将“ \\ x”与十六进制数字一起使用以表示二进制值。 Check the source codes here . 此处检查源代码。 For example, 例如,

LOAD 'hbase://TABLE' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage('CF:I','-caster HBaseBinaryConverter -lt=\\x01\\x02\\xD4') AS (product_id:bytearray);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM