ygerzhedovich commented on code in PR #1501:
URL: https://github.com/apache/ignite-3/pull/1501#discussion_r1087861806


##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/rel/TableScanNodeExecutionTest.java:
##########
@@ -161,29 +157,40 @@ public TestInternalTableImpl(
         }
 
         @Override
-        protected CompletableFuture<Collection<BinaryRow>> enlistCursorInTx(
-                @NotNull InternalTransaction tx,
+        public Publisher<BinaryRow> scan(
                 int partId,
-                long scanId,
-                int batchSize,
+                UUID txId,
+                ClusterNode leaderNode,
+                long leaderTerm,
                 @Nullable UUID indexId,
-                @Nullable BinaryTuple exactKey,
                 @Nullable BinaryTuplePrefix lowerBound,
                 @Nullable BinaryTuplePrefix upperBound,
                 int flags,
                 @Nullable BitSet columnsToInclude
         ) {
-            int fillAmount = Math.min(dataAmount - processedPerPart[partId], 
batchSize);
-
-            Collection<BinaryRow> out = new ArrayList<>(fillAmount);
-
-            for (int i = 0; i < fillAmount; ++i) {
-                out.add(bbRow);
-            }
-
-            processedPerPart[partId] += fillAmount;
-
-            return CompletableFuture.completedFuture(out);
+            return s -> {
+                s.onSubscribe(new Subscription() {
+                    @Override
+                    public void request(long n) {
+                        int fillAmount = Math.min(dataAmount - 
processedPerPart[partId], (int) n);
+
+                        processedPerPart[partId] += fillAmount;
+
+                        for (int i = 0; i < fillAmount; ++i) {
+                            s.onNext(bbRow);
+                        }
+
+                        if (processedPerPart[partId] >= dataAmount) {

Review Comment:
   ```suggestion
                           if (processedPerPart[partId] == dataAmount) {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to