doing a ValueFilter or a ColumnFilter on hbase shell

后端 未结 3 488
长发绾君心
长发绾君心 2021-01-13 16:49

Could anyone please tell me how to do a qualifier filter or ValueFilter from the hbase shell command line?

3条回答
  •  猫巷女王i
    2021-01-13 17:28

    It is very similar to how you would code in any programming language, for instance :-

    import org.apache.hadoop.hbase.filter.CompareFilter
    import org.apache.hadoop.hbase.filter.SingleColumnValueFilter
    import org.apache.hadoop.hbase.util.Bytes
    scan 'tableName', {COLUMNS=>['CF:qualifier1', 'CF:qualifier2'], LIMIT=>10,
    FILTER=>SingleColumnValueFilter.new(Bytes.toBytes('CF'),
    Bytes.toBytes('qualifier1'), CompareFilter::CompareOp.valueOf('EQUAL'),
    Bytes.toBytes('value'))}
    

    You obviously have to change parameters depending on the fiter you use.

提交回复
热议问题