doing a ValueFilter or a ColumnFilter on hbase shell

后端 未结 3 489
长发绾君心
长发绾君心 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条回答
  •  半阙折子戏
    2021-01-13 17:34

    You can instantiate any filter the same way you would do in Java (with JRuby syntax), and supply the filter as:

    filter = ...
    scan 'mytable', FILTER => filter
    

    However, instantiating the filter in the shell directly can be cumbersome, so an easier way is to supply filter as a string using Filter Language. For example, to include all the columns with value equal to 'myvalue' in a scan you would use:

    scan 'mytable', FILTER => "ValueFilter(=, 'binary:myvalue')"
    

    You can check this document as a 'Filter Language' reference.

    (edit for closing double quote)

提交回复
热议问题