From 1025d83d03db5132b5669d5a48a2bd9706741ffc Mon Sep 17 00:00:00 2001 From: Anqi <16240361+Nicole00@users.noreply.github.com> Date: Thu, 30 Apr 2026 15:28:02 +0800 Subject: [PATCH] fix empty batch --- .../com/vesoft/nebula/driver/graph/decode/ResultTable.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/src/main/java/com/vesoft/nebula/driver/graph/decode/ResultTable.java b/client/src/main/java/com/vesoft/nebula/driver/graph/decode/ResultTable.java index b005c9ddc..c34da6638 100644 --- a/client/src/main/java/com/vesoft/nebula/driver/graph/decode/ResultTable.java +++ b/client/src/main/java/com/vesoft/nebula/driver/graph/decode/ResultTable.java @@ -5,7 +5,6 @@ package com.vesoft.nebula.driver.graph.decode; -import com.google.common.base.Charsets; import com.vesoft.nebula.driver.graph.data.ValueWrapper; import com.vesoft.nebula.driver.graph.decode.datatype.DataType; import com.vesoft.nebula.driver.graph.decode.datatype.ValueTypeParser; @@ -14,7 +13,6 @@ import com.vesoft.nebula.proto.graph.VectorBatch; import com.vesoft.nebula.proto.graph.VectorResultTable; import java.nio.ByteOrder; -import java.nio.charset.Charset; import java.util.ArrayList; import java.util.List; @@ -118,7 +116,7 @@ public Row next() { currentBatchRowSize = currentBatch.getBatchRowSize(); } // the current batch is empty or already finished the batch, jump the batch - if (currentBatch.getVectorsCount() == 0 || currentBatchRowIndex >= currentBatchRowSize) { + while (currentBatch.getVectorsCount() == 0 || currentBatchRowIndex >= currentBatchRowSize) { batchIndex++; if (batchIndex >= numBatches) { throw new RuntimeException("no more batch data"); @@ -126,6 +124,7 @@ public Row next() { // reset currentBatchRowIndex to 0 currentBatchRowIndex = 0; currentBatch = new Batch(resultTable.getBatch(batchIndex), byteOrder); + currentBatchRowSize = currentBatch.getBatchRowSize(); } // resolve the current batch