Scan HTable rows for specific column value using HBase shell

前端 未结 7 911
臣服心动
臣服心动 2020-12-12 19:22

I want to scan rows in a HTable from hbase shell where a column family (i.e., Tweet) has a particular value (i.e., user_id).

Now I want to find all

相关标签:
7条回答
  • 2020-12-12 20:10

    Slightly different question but if you you want to query a specific column which is not present in all rows, DependentColumnFilter is your best friend:

    import org.apache.hadoop.hbase.filter.DependentColumnFilter
    scan 'orgtable2', {FILTER => "DependentColumnFilter('cf1','lan',false,=,'binary:fre')"}
    

    The previous scan will return all columns for the rows in which the lan column is present and for which its associated value is equal to fre. The third argument is dropDependentColumn and would prevent the lan column itself to be displayed in the results if set to true.

    0 讨论(0)
提交回复
热议问题