You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2022/05/30 11:49:50 UTC

[ignite-3] 02/02: Add AsyncResultSetImpl.currentPageSize

This is an automated email from the ASF dual-hosted git repository.

ptupitsyn pushed a commit to branch ignite-14972
in repository https://gitbox.apache.org/repos/asf/ignite-3.git

commit 4eeff5d53c264b9c8353d32cbb27a988ca640a57
Author: Pavel Tupitsyn <pt...@apache.org>
AuthorDate: Mon May 30 14:49:39 2022 +0300

    Add AsyncResultSetImpl.currentPageSize
---
 .../org/apache/ignite/internal/sql/api/AsyncResultSetImpl.java | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/AsyncResultSetImpl.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/AsyncResultSetImpl.java
index 2c363696f..726a865fb 100644
--- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/AsyncResultSetImpl.java
+++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/AsyncResultSetImpl.java
@@ -126,6 +126,16 @@ public class AsyncResultSetImpl implements AsyncResultSet {
         return () -> new TransformingIterator<>(batchPage.items().iterator(), SqlRowImpl::new);
     }
 
+    /** {@inheritDoc} */
+    @Override
+    public int currentPageSize() {
+        if (!hasRowSet()) {
+            throw new NoRowSetExpectedException("Query hasn't result set: [type=" + cur.queryType() + ']');
+        }
+
+        return batchPage.items().size();
+    }
+
     /** {@inheritDoc} */
     @Override
     public CompletionStage<? extends AsyncResultSet> fetchNextPage() {