Skip to content

Commit 4e25a7b

Browse files
authored
fix empty batch (#652)
1 parent 6631b06 commit 4e25a7b

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎client/src/main/java/com/vesoft/nebula/driver/graph/decode/ResultTable.java‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
package com.vesoft.nebula.driver.graph.decode;
77

8-
import com.google.common.base.Charsets;
98
import com.vesoft.nebula.driver.graph.data.ValueWrapper;
109
import com.vesoft.nebula.driver.graph.decode.datatype.DataType;
1110
import com.vesoft.nebula.driver.graph.decode.datatype.ValueTypeParser;
@@ -14,7 +13,6 @@
1413
import com.vesoft.nebula.proto.graph.VectorBatch;
1514
import com.vesoft.nebula.proto.graph.VectorResultTable;
1615
import java.nio.ByteOrder;
17-
import java.nio.charset.Charset;
1816
import java.util.ArrayList;
1917
import java.util.List;
2018

@@ -118,14 +116,15 @@ public Row next() {
118116
currentBatchRowSize = currentBatch.getBatchRowSize();
119117
}
120118
// the current batch is empty or already finished the batch, jump the batch
121-
if (currentBatch.getVectorsCount() == 0 || currentBatchRowIndex >= currentBatchRowSize) {
119+
while (currentBatch.getVectorsCount() == 0 || currentBatchRowIndex >= currentBatchRowSize) {
122120
batchIndex++;
123121
if (batchIndex >= numBatches) {
124122
throw new RuntimeException("no more batch data");
125123
}
126124
// reset currentBatchRowIndex to 0
127125
currentBatchRowIndex = 0;
128126
currentBatch = new Batch(resultTable.getBatch(batchIndex), byteOrder);
127+
currentBatchRowSize = currentBatch.getBatchRowSize();
129128
}
130129

131130
// resolve the current batch

0 commit comments

Comments
 (0)