Skip to content

Commit

Permalink
fix HBase PrefixFilter bug (#2364)
Browse files Browse the repository at this point in the history
  • Loading branch information
haohao0103 authored Nov 29, 2023
1 parent 197e8a0 commit d376b02
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,18 @@ default R scan(String table, Set<byte[]> prefixes) {

/**
* Scan records by rowkey start and prefix from a table
* TODO: setRowPrefixFilter deprecated since HBase 2.5.0, will be removed in 4.0.0,
* use setStartStopRowForPrefixScan(byte[]) instead.
*/
default R scan(String table, byte[] startRow, boolean inclusiveStart,
byte[] prefix) {
Scan scan = new Scan().withStartRow(startRow, inclusiveStart)
.setFilter(new PrefixFilter(prefix));
final Scan scan = new Scan();
if(startRow == prefix) {
scan.setRowPrefixFilter(prefix);
} else {
scan.withStartRow(startRow, inclusiveStart)
.setFilter(new PrefixFilter(prefix));
}
return this.scan(table, scan);
}

Expand Down

0 comments on commit d376b02

Please sign in to comment.