我使用bytes.tobytes()来设置扫描范围,如果输入stumber=“aaaa00000”,结果是“aaaa000000”~“aaaaaa000008”,为什么不包括“aaaa000009”?
for (String stumber : stumbersArr) {
byte[] startRow = Bytes.toBytes(stumber + "0");
byte[] endRow = Bytes.toBytes(stumber + "9");
Scan scan = new Scan(startRow, endRow);
Filter filter1 = new RowFilter(CompareFilter.CompareOp.EQUAL, new SubstringComparator(stumber));
scan.setFilter(filter1);
scan.setMaxVersions(versions);
ResultScanner scanner1 = table.getScanner(scan);
Cell[] cells;
for (Result res : scanner1) {
cells = res.rawCells();
list.addAll(getHBaseTableDataListFromCells(cells));
}
}
1条答案
按热度按时间lvjbypge1#
由于结束边界是独占的,请参阅有关扫描的文档。