介于我百度的时候发现文档比较少 就写一下防止忘记
SingleColumnValueFilter('<family>', '<qualifier>', <compare operator>, '<comparator>', <filterIfColumnMissing_boolean>, <latest_version_boolean>)
filterStr = "SingleColumnValueFilter('entry', 'num', =, 'substring:25', true, false)";
note:
comparator需要加binary, 否则可能会抛错误, 我也想想是为什么
rownumber 可以把符合条件的 rownumber 个选出来 而不是选rownumber再进行filter
filter = "SingleColumnValueFilter('f1', 'ax', =, 'binary:-1', true, false)"
s = t.scannerListWithFilter(table = 'M_SEED_USER',filter = filter, numRows=500)
scan = Hbase.TScan()
#scan = Hbase.TScan()
scan.filterString = filter
scan.startRow = startRow
scan.stopRow = stopRow
scannerId = self.client.scannerOpenWithScan(table, scan, {})
这样就可以把columnfamily为f1的column ax = -1 的值取出来
SingleColumnValueFilter最后一个参数改为True, 表示选最新的数据