HBase API에 매우 익숙하며 다음 작업을 수행 할 때 이상한 결과가 나타납니다.여러 필터링 조건을 사용하는 HBase 스캔 API
여러 필터를 기반으로 검색을 시도하고 있습니다. 모든 필터 조건을 통과하려고합니다. 아래 코드를 사용하고 있습니다.
FilterList filterList = new FilterList(FilterList.Operator.MUST_PASS_ALL);
Filter pageFilter = new PageFilter(5000);
filterList.addFilter(pageFilter);
SingleColumnValueFilter filterOne = new SingleColumnValueFilter(Bytes.toBytes(COLUMN_FAMILY),
Bytes.toBytes(COLUMN_NAME1), CompareOp.EQUAL, Bytes.toBytes(value1));
filterList.addFilter(filterOne);
SingleColumnValueFilter filterTwo = new SingleColumnValueFilter(Bytes.toBytes(COLUMN_FAMILY),
Bytes.toBytes(COLUMN_NAME2), CompareOp.EQUAL, Bytes.toBytes(value2));
filterList.addFilter(filterOne);
filterList.addFilter(filterTwo);
//Scan
Scan scan = new Scan();
scan.setFilter(filterList);
Result result;
try {
scanner = hTable.getScanner(scan);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
while ((result = scanner.next()) != null) {
//print the result.
}
//If I am adding multiple SingleColumnValueFilter and I am not doing a addCoulmn() to the scan I am not getting any result even though there are records.
//If I am adding a column to scan then I am seeing results. Initially the result set is matching my filter condition but if I am running for bigger hbase data set then I am seeing bad results.
//If I am adding multiple addCoulmn() to my scan then I am not seeing any result
나는 적절한 예를 찾으려고 노력하지만 아무도 작동하지 않는 것 같습니다. 이 방향에서 도움을 주시면 대단히 감사하겠습니다. 미리 감사드립니다.
는 왜 두 번 filterTwo를 추가 할 수 있습니다 희망 다음
setFilterIfMissing(boolean)
방법을 확인? – Comencau스캐너 변수가 생성 된 곳이 없습니다. – Comencau