diff --git a/hugegraph-hbase/src/main/java/org/apache/hugegraph/backend/store/hbase/HbaseSessions.java b/hugegraph-hbase/src/main/java/org/apache/hugegraph/backend/store/hbase/HbaseSessions.java index 06cbf9ab73..d05e5a7880 100644 --- a/hugegraph-hbase/src/main/java/org/apache/hugegraph/backend/store/hbase/HbaseSessions.java +++ b/hugegraph-hbase/src/main/java/org/apache/hugegraph/backend/store/hbase/HbaseSessions.java @@ -19,6 +19,7 @@ import java.io.IOException; import java.io.InterruptedIOException; +import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -418,8 +419,17 @@ default R scan(String table, Set prefixes) { */ default R scan(String table, byte[] startRow, boolean inclusiveStart, byte[] prefix) { - Scan scan = new Scan().withStartRow(startRow, inclusiveStart) - .setFilter(new PrefixFilter(prefix)); + Scan scan = new Scan(); + if (table.equals("g_oe") || table.equals("g_ie")) { + short value = (short) (((startRow[0] << 8) | (startRow[1] & 0xFF)) +1); + byte[] endRow = ByteBuffer.allocate(2).putShort(value).array(); + scan.withStartRow(startRow, inclusiveStart) + .withStopRow(endRow) + .setFilter(new PrefixFilter(prefix)); + } else { + scan.withStartRow(startRow, inclusiveStart) + .setFilter(new PrefixFilter(prefix)); + } return this.scan(table, scan); }