NameError:未初始化的常量FILTER

时间:2014-03-07 03:45:09

标签: filter initialization hbase constants nameerror

如何在HBase上配置过滤器?

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:未初始化的常量FILTER

1 个答案:

答案 0 :(得分: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;