diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/BackendTable.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/BackendTable.java index 280e8187aa..12e7131945 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/BackendTable.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/BackendTable.java @@ -168,9 +168,9 @@ public List getSplits(Session session, long splitSize) { long maxKey = this.maxKey(); double each = maxKey / count; - long offset = 0L; - String last = this.position(offset); List splits = new ArrayList<>((int) count); + String last = START; + long offset = 0L; while (offset < maxKey) { offset += each; if (offset > maxKey) { diff --git a/hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBTable.java b/hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBTable.java index ba52f7e56c..45ae08a9f0 100644 --- a/hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBTable.java +++ b/hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBTable.java @@ -327,7 +327,7 @@ public long estimateNumKeys(Session session) { @Override public byte[] position(String position) { - if (END.equals(position)) { + if (START.equals(position) || END.equals(position)) { return null; } return StringEncoding.decodeBase64(position);