如何用给定列(非空)过滤出行? [英] How to filter out rows with given column(not null)?
问题描述
我想你正在寻找<$ c HBase中的$ c> SingleColumnValueFilter 。正如 API中所述, a>
如果在一行中找不到列,那么要防止发出整行,可以使用
setFilterIfMissing (布尔)
在Filter对象上。否则,如果找到该列,则只有当该值通过时,整行才会被发射。
但是 SingleColumnValueFilter
如果值失败,如果ColumnX不能使用的定点值,如果ColumnX ==X
或
带上了这一行和 setFilterIfMissing(true)
,这样如果ColumnX有一些值,它会返回。
你在正确的方向。
I want to do a hbase scan with filters. For example, my table has column family A,B,C, and A has a column X. Some rows have the column X and some do not. How can I implement the filter to filter out all the rows with column X?
I guess you are looking for SingleColumnValueFilter
in HBase. As mentioned in the API
To prevent the entire row from being emitted if the column is not found on a row, use
setFilterIfMissing(boolean)
on Filter object. Otherwise, if the column is found, the entire row will be emitted only if the value passes. If the value fails, the row will be filtered out.
But SingleColumnValueFilter
would want a value to have Column X "CompareOp" to something, say bring this row if ColumnX == "X"
or
bring this row if ColumnX != "A sentinel value that ColumnX can never take" and setFilterIfMissing(true)
so that if ColumnX has some value, it is returned.
I hope this nudges you in the right direction.
这篇关于如何用给定列(非空)过滤出行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!