lowka commented on code in PR #2342:
URL: https://github.com/apache/ignite-3/pull/2342#discussion_r1275208516


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImpl.java:
##########
@@ -820,6 +830,27 @@ private void enlist(SourceAwareIgniteRel rel) {
             }.visit(fragment.root());
         }
 
+        private CompletableFuture<MultiStepPlan> mapFragments(MultiStepPlan 
plan) {
+            List<IgniteRel> fragments = plan.fragments()
+                    .stream()
+                    .map(Fragment::root)
+                    .collect(Collectors.toList());

Review Comment:
   Added `TransformingIterator::newIterable`. And replaced `List<IgniteRel>` 
with `Iterable<IgniteRel>` in DepedencyResolver's signature.



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImpl.java:
##########
@@ -952,4 +983,30 @@ public interface ImplementorFactory<RowT> {
         /** Creates the relational node implementor with the given context. */
         LogicalRelImplementor<RowT> create(ExecutionContext<RowT> ctx, 
ResolvedDependencies resolvedDependencies);
     }
+
+    static final class FetchColocationGroups {
+
+        private final ResolvedDependencies deps;
+
+        FetchColocationGroups(ResolvedDependencies deps) {
+            this.deps = deps;
+        }
+
+        CompletableFuture<Map<Integer, ColocationGroup>> execute() {
+            List<CompletableFuture<Pair<Integer, ColocationGroup>>> list = new 
ArrayList<>();
+
+            for (Integer tableId : deps.tableIds()) {
+                CompletableFuture<ColocationGroup> f = 
deps.fetchColocationGroup(tableId);
+                list.add(f.thenApply(c -> new Pair<>(tableId, c)));
+            }
+
+            CompletableFuture<Void> all = 
CompletableFuture.allOf(list.toArray(new CompletableFuture[0]));
+
+            return all.thenApply(
+                    v -> list.stream()
+                            .map(CompletableFuture::join)
+                            .collect(Collectors.toMap(Pair::getFirst, 
Pair::getSecond)));
+
+        }
+    }

Review Comment:
   Fixed.



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to