Github user xubo245 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2816#discussion_r229155198
--- Diff:
core/src/main/java/org/apache/carbondata/core/scan/result/RowBatch.java ---
@@ -100,4 +100,25 @@ public int getSize() {
counter++;
return row;
}
+
+ /**
+ * read next batch
+ *
+ * @param batch batch size
+ * @return rows
+ */
+ public List<Object[]> nextBatch(int batch) {
+ if (!hasNext()) {
+ throw new NoSuchElementException();
+ }
+ List<Object[]> row;
+ if (counter + batch > rows.size()) {
+ row = rows.subList(counter, rows.size());
+ counter = counter + row.size();
--- End diff --
counter != row.size() before change readNextBatchRow(batch) to
readNextBatchRow(). the batch is different between withBatch(batch) and
readNextBatchRow(batch) before. But after change, the batch is the same, so
counter = row.size()
---