alex-plekhanov commented on code in PR #13862:
URL: https://github.com/apache/ignite/pull/13862#discussion_r4691090512


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/trait/DistributionFunction.java:
##########
@@ -315,7 +315,7 @@ public AffinityDistribution(int cacheId, Object identity) {
 
             AffinityAdapter<Row> aff = new 
AffinityAdapter<>(affSrvc.affinity(cacheId), k.toIntArray(), ctx.rowHandler());
 
-            return new Partitioned<>(assignments, aff);
+            return new Partitioned<>(assignments, m.nodeIds(), aff);

Review Comment:
   Add test for this problem?



##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java:
##########
@@ -311,6 +346,20 @@ public int[] partitions(UUID nodeId) {
         if (F.isEmpty(assignments) || primaryAssignment)
             return null;
 
+        if (partFilter >= 0)
+            return Objects.equals(nodeId, 
F.first(assignments.get(partFilter))) ? new int[] {partFilter} : U.EMPTY_INTS;

Review Comment:
   Potential index out of bounds on assignments.get



-- 
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