2014-03-07 543 views
0

如何在HBase上配置過濾器?NameError:未初始化的常量FILTER

hbase(main):005:0> scan 'List', { 
    COLUMNS => 'Attributes:supplierPartNumber', 
    FILTER => "SingleColumnValueFilter.new(Bytes.toBytes('Attributes'), 
    Bytes.toBytes('supplierPartNumber'), 
    CompareFilter::CompareOp.valueOf('EQUAL'), 
    Bytes.toBytes('00980866000P'))" 
} 

NameError: uninitialized constant FILTER

回答

0

首先導入所有這些濾鏡包,然後他凡特篩選命令。我認爲這會幫助你

hbase(main):009:0> import org.apache.hadoop.hbase.util.Bytes; 
    hbase(main):009:0> import org.apache.hadoop.hbase.filter.SingleColumnValueFilter; 
    hbase(main):009:0> import org.apache.hadoop.hbase.filter.BinaryComparator; 
    hbase(main):009:0> import org.apache.hadoop.hbase.filter.CompareFilter; 
    hbase(main):009:0> import org.apache.hadoop.hbase.filter. Filter; 
相關問題